From 7f79cfb7435541aac04fdca2a12f114c48df1175 Mon Sep 17 00:00:00 2001 From: Rahul Lalmalani Date: Mon, 27 Oct 2025 16:18:48 -0700 Subject: [PATCH 1/7] Revise Live Plugins documentation for Public Beta Updated the documentation for Live Plugins to reflect the transition from pilot to Public Beta, clarified setup instructions, and improved descriptions of functionality. Eliminated references to CLI and added instructions for accessing via WYSIWYG UI --- .../libraries/mobile/apple/live-plugins.md | 93 +++++-------------- 1 file changed, 22 insertions(+), 71 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md index 69f1d6d0d8..d3263634c1 100644 --- a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md +++ b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md @@ -3,24 +3,26 @@ title: Live Plugins strat: swift --- -Live plugins are JavaScript code snippets published to your Segment workspace and then downloaded directly to the mobile devices of end users. Live plugins let you perform real-time modifications to events before they leave the mobile device. +Segment has launched the [Auto-Instrumentation Public Beta](https://segment.com/docs/connections/auto-instrumentation/){:target="_blank"} to Public Beta, which simplifies instrumenting your websites & apps with a simple WYSIWYG interface, directly from your Segment workspace. In addition to creating events remotely, Segment also offers the ability to transform events remotely via Live Plugins. -On this page, you'll learn how to set up live plugins and how to create your own live plugins. You'll also see example live plugins that address common use cases. +Live Plugins are JavaScript code snippets which are published via your Segment source, and then downloaded directly to the mobile devices of end users. Live Plugins let you perform real-time modifications to events, before they leave the mobile device, without having to rebuild & redistribute your apps. -> info "Live Plugins is in pilot" -> Live Plugins is currently in Pilot and available to select Business Tier Customers only. To enable this feature for your workspace, contact your CSM. +On this page, you'll learn how to set up your mobile app to support Live Plugins, and how to create and deploy your own Live Plugins directly to your end users. You'll also see examples of Live Plugins that address common use cases. + +> info "Live Plugins is in Public Beta" +> Live Plugins is currently in Beta and available to select Business Tier Customers only. To enable this feature for your workspace, contact your CSM. ## Live plugins overview -You can use JavaScript live plugins with Analytics-Swift and Analytics-Kotlin to filter and modify data remotely. As a result, you can filter and modify analytics events without having to deploy updates to the app store for each change, ensuring data quality and consistency for all your mobile users. +You can use JavaScript live plugins with Analytics-Swift and Analytics-Kotlin to filter and modify data remotely. As a result, you can filter and modify Analytics events without having to deploy updates to the app store for each change, ensuring data quality and consistency for all your mobile users. -Because live plugins let you modify event data before it leaves a mobile device, you can use the same function to modify data meant for all your cloud-mode and device-mode destinations. +Because Live Plugins let you modify event data before it leaves a mobile device, you can use the same Javascript code to modify data meant for all your cloud-mode and device-mode destinations, or scope your changes to specific Destinations. ## Setup -To use live plugins, you first need to set up your mobile app with a one-time configuration. +To use Live Plugins, you first need to set up your mobile app with a one-time configuration. -To configure live plugins: +To configure Live Plugins: 1. Include the [Analytics Live for Swift plugin](https://github.com/segment-integrations/analytics-swift-live){:target="_blank"} and [Analytics Live for Kotlin plugin](https://github.com/segment-integrations/analytics-kotlin-live){:target="_blank"} @@ -49,68 +51,17 @@ analytics.add(LivePlugins()) {% endcodeexampletab %} {% endcodeexample %} -After you've completed setup, you can deploy your apps to the Apple App Store and Google Play Store. You can then add new JavaScript plugin code to your mobile apps through the CLI and perform updates as often as needed. - -## Live plugin tutorial - -This section walks you through a sample live plugin implementation. - -### 1. Write a live plugin in JavaScript - -Copy and save the following file, which anonymizes events by removing user IDs and device IDs: - -```js -class PrivacyLivePlugin extends LivePlugin { - // The execute function is called for every event. - execute(event) { - // Remove the user ID and device ID from the event to anonymize it. - event.userId = null; - delete event.context.device.id; - return event; - } -} -``` - -Note the name of your saved file. You'll need it in the next step. - -### 2. Deploy the plugin with the Live Plugin CLI - -With your plugin saved, you'll next deploy the plugin with Segment's Live Plugin CLI. Follow these steps: - -#### Install the CLI with Homebrew - -Run this command to install the Segment CLI: - -```shell -$ brew install segment-integrations/formulae/segmentcli -``` - -#### Authenticate with Segment - -Next, you'll authenticate with Segment to give the CLI access to your workspace: - -1. Within your Segment workspace, navigate to **Settings > Workspace Settings > Access Management > Tokens**. -2. Click **Create token** to generate a new token with the `Workspace Owner` role. Copy the token. -3. Return to your command line and use your token to authenticate: - - ```shell - $ segmentcli auth - ``` -4. Copy your source's ID. You'll find the Source ID under **Settings > API Keys > Source ID** on your source's page. -7. Use your source ID and live plugin file name to upload your live plugin: - - ```shell - $ segmentcli liveplugins upload - ``` - -You've now successfully attached your live plugin(s) to your mobile source. The next time your users launch your app, their Segment SDK will download the latest live plugins, which will run every time new events are generated. - -> info "" -> Because the CDN settings object takes a few minutes to rebuild, your live plugins might not be available immediately. +After you've completed setup, you can deploy your apps to the Apple App Store and Google Play Store. You can then add new JavaScript plugin code to your mobile apps through the Segment website, and perform updates as often as needed. ## Create your own live plugin -Follow the steps in this section to create your own live plugin. +To access Live Plugins for you Swift and Kotlin sources +1. Navigate to Connections > Sources. +2. Select your Swift or Kotlin source (or create a new one). +3. From the Source's overview, select the Live Plugin tab +Access Live Plugins from the Source overview tab + +Follow the steps in this section to create and deploy your own Live Plugin. ### 1. Subclass the `LivePlugin` class @@ -137,9 +88,9 @@ analytics.add(new UserIdLivePlugin(LivePluginType.enrichment, null)); In this example, you've created a `UserIdLivePlugin` by subclassing `LivePlugin` and implementing the `execute()` function. This function gets applied to every event. -### 2. Add your live plugin to the Analytics instance +### 2. Add your Live Plugin to the Analytics instance -After you define your custom live plugin, you need to add it to the Analytics instance. The Analytics object is globally accessible, and you can use the `add()` method to include your live plugin. +After you define your custom Live Plugin, you need to add it to the Analytics instance. The Analytics object is globally accessible, and you can use the `add()` method to include your Live Plugin. When you adding a new instance, you specify the `LivePluginType` and the destination to which it applies, or use null to apply it to all destinations. @@ -325,7 +276,7 @@ This section covers the primary event callbacks. #### The `execute` callback -The `execute` callback function serves as the primary entry point for live plugins to intercept and modify events. When you implement the `execute` function in your plugin, you can decide whether to keep the event by returning it or drop it by returning `null`. +The `execute` callback function serves as the primary entry point for Live Plugins to intercept and modify events. When you implement the `execute` function in your plugin, you can decide whether to keep the event by returning it or drop it by returning `null`. This callback is versatile, as you can use it for various event types when the event type itself is not critical. Additionally, `execute` lets you invoke more specific callbacks based on the event type. @@ -351,4 +302,4 @@ There's one non-event function: | Function | Description | | --------------- | --------------------------------------------------------------------------- | -| `reset(): null` | Called when the Analytics instance is about to be reset. Nothing to return. | \ No newline at end of file +| `reset(): null` | Called when the Analytics instance is about to be reset. Nothing to return. | From 2edfa9fbd1940939616b4ff6b98ad1c12f187b41 Mon Sep 17 00:00:00 2001 From: Rahul Lalmalani Date: Tue, 28 Oct 2025 11:54:01 -0700 Subject: [PATCH 2/7] Fix image tag for Live Plugins access instructions Updated the image tag for accessing Live Plugins in the documentation. --- .../sources/catalog/libraries/mobile/apple/live-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md index d3263634c1..e25e4c0ccd 100644 --- a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md +++ b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md @@ -59,7 +59,7 @@ To access Live Plugins for you Swift and Kotlin sources 1. Navigate to Connections > Sources. 2. Select your Swift or Kotlin source (or create a new one). 3. From the Source's overview, select the Live Plugin tab -Access Live Plugins from the Source overview tab +Access Live Plugins from the Source overview tab Follow the steps in this section to create and deploy your own Live Plugin. From 12e22240bad60aaa46c754dbffab61282cc20827 Mon Sep 17 00:00:00 2001 From: Rahul Lalmalani Date: Tue, 28 Oct 2025 14:27:35 -0700 Subject: [PATCH 3/7] Revise Live Plugins documentation for clarity Cleaned up redundant text --- .../libraries/mobile/apple/live-plugins.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md index e25e4c0ccd..2ddb11ce55 100644 --- a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md +++ b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md @@ -3,20 +3,20 @@ title: Live Plugins strat: swift --- -Segment has launched the [Auto-Instrumentation Public Beta](https://segment.com/docs/connections/auto-instrumentation/){:target="_blank"} to Public Beta, which simplifies instrumenting your websites & apps with a simple WYSIWYG interface, directly from your Segment workspace. In addition to creating events remotely, Segment also offers the ability to transform events remotely via Live Plugins. +Segment has launched the [Auto-Instrumentation](https://segment.com/docs/connections/auto-instrumentation/){:target="_blank"} to Public Beta, which simplifies instrumenting your websites & apps with a simple WYSIWYG interface, directly from your Segment workspace. As part of this launch, Segment also offers the ability to transform events remotely via Live Plugins. -Live Plugins are JavaScript code snippets which are published via your Segment source, and then downloaded directly to the mobile devices of end users. Live Plugins let you perform real-time modifications to events, before they leave the mobile device, without having to rebuild & redistribute your apps. +Live Plugins are JavaScript code snippets which are published from your Segment workspace directly to the devices of your end users. Live Plugins let you perform real-time modifications to events, before they leave the end-user device, without having to rebuild & redistribute your apps. On this page, you'll learn how to set up your mobile app to support Live Plugins, and how to create and deploy your own Live Plugins directly to your end users. You'll also see examples of Live Plugins that address common use cases. > info "Live Plugins is in Public Beta" -> Live Plugins is currently in Beta and available to select Business Tier Customers only. To enable this feature for your workspace, contact your CSM. +> Live Plugins is currently in Beta for Swift & Kotlin, and available to select Business Tier Customers only. To enable this feature for your workspace, contact your CSM. -## Live plugins overview +## Live Plugins overview You can use JavaScript live plugins with Analytics-Swift and Analytics-Kotlin to filter and modify data remotely. As a result, you can filter and modify Analytics events without having to deploy updates to the app store for each change, ensuring data quality and consistency for all your mobile users. -Because Live Plugins let you modify event data before it leaves a mobile device, you can use the same Javascript code to modify data meant for all your cloud-mode and device-mode destinations, or scope your changes to specific Destinations. +Because Live Plugins let you modify event data before it leaves a mobile device, you can use the same Javascript code to modify data across all your cloud-mode and device-mode destinations, or you can scope your changes to specific destinations. ## Setup @@ -24,8 +24,8 @@ To use Live Plugins, you first need to set up your mobile app with a one-time co To configure Live Plugins: -1. Include the [Analytics Live for Swift plugin](https://github.com/segment-integrations/analytics-swift-live){:target="_blank"} - and [Analytics Live for Kotlin plugin](https://github.com/segment-integrations/analytics-kotlin-live){:target="_blank"} +1. Include [Analytics-Live for Swift plugin](https://github.com/segment-integrations/analytics-swift-live){:target="_blank"} + and [Analytics-Live for Kotlin](https://github.com/segment-integrations/analytics-kotlin-live){:target="_blank"} in your project. 2. Add the plugin to your instance of Analytics, using the following code: @@ -53,7 +53,7 @@ analytics.add(LivePlugins()) After you've completed setup, you can deploy your apps to the Apple App Store and Google Play Store. You can then add new JavaScript plugin code to your mobile apps through the Segment website, and perform updates as often as needed. -## Create your own live plugin +## Create your own Live Plugin To access Live Plugins for you Swift and Kotlin sources 1. Navigate to Connections > Sources. @@ -102,7 +102,7 @@ analytics.add(new UserIdLivePlugin(LivePluginType.enrichment, "adobe")); ### 3. Use the `LivePluginType` enums -To control when your custom live plugin runs during event processing, you can use `LivePluginType` enums, which define different timing options for your live plugin. Here are the available types: +To control when your custom Live Plugin runs during the event lifecycle, you can use `LivePluginType` enums, which define different timing options for your Live Plugin. Here are the available types: ```js const LivePluginType = { @@ -113,9 +113,9 @@ const LivePluginType = { } ``` -With these enums, you can select the timing that best fits your custom live plugin's target use case. These types align with categories used for Native Plugins. +With these enums, you can select the timing that best fits your custom Live Plugin's target use case. These types align with categories used for Native Plugins. -## Live plugin examples +## Live Plugin examples The following live plugin examples address common use cases: @@ -252,7 +252,7 @@ analytics.add(new DownSampleLivePlugin(LivePluginType.enrichment, null)); ## Live Plugins API -Live plugins follow an interface that let you intercept Segment events and modify their data. This interface includes several functions that you can implement for custom behavior: +Live Plugins expose an interface that lets you intercept Segment events and modify their data. This interface includes several functions that you can implement for custom behavior: ```js // Interface for Live Plugins: From 7f7e5a275c2afa02d785afbc31dfdc92ed1a2410 Mon Sep 17 00:00:00 2001 From: pwseg Date: Thu, 30 Oct 2025 11:36:37 -0500 Subject: [PATCH 4/7] update intro section --- .../catalog/libraries/mobile/apple/live-plugins.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md index 2ddb11ce55..11b0ea8bdc 100644 --- a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md +++ b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md @@ -3,14 +3,14 @@ title: Live Plugins strat: swift --- -Segment has launched the [Auto-Instrumentation](https://segment.com/docs/connections/auto-instrumentation/){:target="_blank"} to Public Beta, which simplifies instrumenting your websites & apps with a simple WYSIWYG interface, directly from your Segment workspace. As part of this launch, Segment also offers the ability to transform events remotely via Live Plugins. +Live Plugins let you modify analytics events in real time, directly on user devices, without rebuilding or redeploying your app. They’re JavaScript snippets that you publish from your Segment workspace, where they run on your users’ mobile devices to filter or transform data before it’s sent to Segment. -Live Plugins are JavaScript code snippets which are published from your Segment workspace directly to the devices of your end users. Live Plugins let you perform real-time modifications to events, before they leave the end-user device, without having to rebuild & redistribute your apps. +Live Plugins work alongside [Auto-Instrumentation](/docs/connections/auto-instrumentation/) to give you flexible control over your event data. -On this page, you'll learn how to set up your mobile app to support Live Plugins, and how to create and deploy your own Live Plugins directly to your end users. You'll also see examples of Live Plugins that address common use cases. +On this page, you’ll learn how to set up your mobile app to support Live Plugins, create and deploy custom plugins, and explore examples for common use cases. > info "Live Plugins is in Public Beta" -> Live Plugins is currently in Beta for Swift & Kotlin, and available to select Business Tier Customers only. To enable this feature for your workspace, contact your CSM. +> Live Plugins is in public beta for Swift and Kotlin and available to select Business Tier Customers only. To enable this feature for your workspace, contact your CSM. ## Live Plugins overview From d4b75337b746a82a713f4fc30105ecf2af196fed Mon Sep 17 00:00:00 2001 From: pwseg Date: Thu, 30 Oct 2025 11:40:20 -0500 Subject: [PATCH 5/7] overview rewording --- .../sources/catalog/libraries/mobile/apple/live-plugins.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md index 11b0ea8bdc..bb33bb0000 100644 --- a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md +++ b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md @@ -14,9 +14,9 @@ On this page, you’ll learn how to set up your mobile app to support Live Plugi ## Live Plugins overview -You can use JavaScript live plugins with Analytics-Swift and Analytics-Kotlin to filter and modify data remotely. As a result, you can filter and modify Analytics events without having to deploy updates to the app store for each change, ensuring data quality and consistency for all your mobile users. +You can use JavaScript Live Plugins with Analytics-Swift and Analytics-Kotlin to modify or filter event data directly on user devices. This lets you make real-time updates to your tracking logic without redeploying your app, helping you maintain data quality and consistency across your mobile users. -Because Live Plugins let you modify event data before it leaves a mobile device, you can use the same Javascript code to modify data across all your cloud-mode and device-mode destinations, or you can scope your changes to specific destinations. +Because Live Plugins run before data leaves the device, you can apply the same logic to all destinations or target specific destinations as needed. ## Setup From 63f44ee24137bec4d73061f2ceecf07310600985 Mon Sep 17 00:00:00 2001 From: pwseg Date: Thu, 30 Oct 2025 11:41:14 -0500 Subject: [PATCH 6/7] fix typo --- .../sources/catalog/libraries/mobile/apple/live-plugins.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md index bb33bb0000..3b273cd3ff 100644 --- a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md +++ b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md @@ -55,7 +55,8 @@ After you've completed setup, you can deploy your apps to the Apple App Store an ## Create your own Live Plugin -To access Live Plugins for you Swift and Kotlin sources +To access Live Plugins for your Swift and Kotlin sources: + 1. Navigate to Connections > Sources. 2. Select your Swift or Kotlin source (or create a new one). 3. From the Source's overview, select the Live Plugin tab From 71dde5887633e423bed709607bf30c44db8be545 Mon Sep 17 00:00:00 2001 From: pwseg Date: Thu, 30 Oct 2025 11:42:29 -0500 Subject: [PATCH 7/7] last changes --- .../sources/catalog/libraries/mobile/apple/live-plugins.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md index 3b273cd3ff..2ed355627e 100644 --- a/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md +++ b/src/connections/sources/catalog/libraries/mobile/apple/live-plugins.md @@ -57,9 +57,9 @@ After you've completed setup, you can deploy your apps to the Apple App Store an To access Live Plugins for your Swift and Kotlin sources: -1. Navigate to Connections > Sources. +1. In your Segment workspace, go to **Connections > Sources**. 2. Select your Swift or Kotlin source (or create a new one). -3. From the Source's overview, select the Live Plugin tab +3. From the source's overview page, click the Live Plugin tab.. Access Live Plugins from the Source overview tab Follow the steps in this section to create and deploy your own Live Plugin.