Migrate from the Adobe Analytics tag extension to the Web SDK tag extension
This implementation path involves a methodical migration approach to move from the Adobe Analytics tag extension to the Web SDK tag extension. Other implementation paths are covered on separate pages:
- AppMeasurement to Web SDK JavaScript library: A smooth and methodical approach to migrate to the Web SDK, except it does not use tags. Instead, you manually remove the Adobe Analytics data collection library (
AppMeasurement.js
) and replace it with the Web SDK JavaScript library (alloy.js
). - Web SDK tag extension: A fresh Web SDK installation where you manage the implementation using tags in Adobe Experience Platform Data Collection. It requires the Adobe Analytics ExperienceEvent field group, which includes typical Analytics variables to be included in your XDM schema.
- Web SDK JavaScript library: A fresh Web SDK installation using the Web SDK JavaScript library (
alloy.js
). Manage the implementation yourself instead of using the tags UI. It requires the Adobe Analytics ExperienceEvent field group, which includes typical Analytics variables to be included in your XDM schema.
Advantages and disadvantages of this implementation path
Using this migration approach has both advantages and disadvantages. Carefully weigh each option to decide which approach is best for your organization.
- No code changes on your site: Since your implementation already has tags installed, all migration updates can be made in the tags interface.
- Uses your existing implementation: This approach does not require a net-new implementation. While it does require new rule actions, you can reuse your existing data elements and rule conditions with minimal changes.
- Does not require a schema: For this stage of migrating to the Web SDK, you don’t need an XDM schema. Instead, you can populate the
data
object, which sends data straight to Adobe Analytics. Once migration to the Web SDK is complete, then you can create a schema for your organization and use datastream mapping to populate applicable XDM fields. If a schema were required at this stage of the migration process, your organization would be forced to use an Adobe Analytics XDM schema. Use of this schema makes it more difficult for your organization to use your own schema in the future.
- Implementation technical debt: Since this approach uses a modified form of your existing implementation, it can be harder to track implementation logic and perform changes when needed. Custom code can be particularly difficult to debug.
- Requires mapping to send data to Platform: When your organization is ready to use Customer Journey Analytics, you must send data to a data set in Adobe Experience Platform. This action requires that every field in the
data
object be an entry in the datastream mapping tool that assigns it to an XDM schema field. Mapping only needs to be done once for this workflow, and it doesn’t involve making implementation changes. However, it is an extra step that is not required when sending data in an XDM object.
Adobe recommends following this implementation path in the following scenarios:
- You have an existing implementation using the Adobe Analytics tag extension. If you have an implementation using AppMeasurement, follow Migrate from AppMeasurement to the Web SDK instead.
- You intend to use Customer Journey Analytics in the future, but do not want to replace your Analytics implementation with a Web SDK implementation from scratch. Replacing your implementation from scratch on the Web SDK requires the most effort, but also offers the most viable long-term implementation architecture. If your organization is willing to go through the effort of a clean Web SDK implementation, see Ingest data via the Adobe Experience Platform Web SDK in the Customer Journey Analytics user guide.
Steps required to migrate to the Web SDK
The following steps contain concrete goals to work towards. Click each step for detailed instructions on how to accomplish it.
Create a datastream in Adobe Experience Platform Data Collection. When you send data to this datastream, it forwards data to Adobe Analytics. In the future, this same datastream forwards data to Customer Journey Analytics.
- Navigate to experience.adobe.com and log in using your credentials.
- Use the home page or product selector in the top right to navigate to Data Collection.
- In the left navigation, select Datastreams.
- Select New Datastream.
- Enter the desired name, then select Save.
- Once the datastream is created, select Add Service.
- In the service drop-down menu, select Adobe Analytics.
- Enter the same report suite ID as the site you currently send analytics data to. Click Save.
Your datastream is now ready to receive and pass along data to Adobe Analytics.
This section prepares your tag for the bulk of the migration effort taking place in the next step.
-
Click the hamburger icon in the top left of the Adobe Experience Platform interface, then select Tags.
-
Select the desired tag property.
-
In the left navigation of the tag property, select Extensions.
-
Select Catalog near the top to see a list of all available extensions.
-
Search for and select the Adobe Experience Platform Web SDK extension, then click Install on the right.
-
The extension configuration settings appear. Locate the Datastreams section, and select the datastream that you created in the previous step.
-
Select Save.
Your tag property now has the Web SDK installed.
The data object data element provides an intuitive framework to configure a payload that the Web SDK uses to send to a datastream. Most rules that you update in the following step interact with this data element.
-
In the left navigation of the tags interface, select Data Elements.
-
Select Add Data Element
-
Give the data element the following settings:
- Name: Anything you’d like, such as “Data layer” or “Data object”
- Extension: Adobe Experience Platform Web SDK
- Data Element Type: Variable
- Check boxes can remain as-is
-
On the right, select the following settings:
- Property radio button: Data
- Solution: Adobe Analytics
-
Select Save.
Your tag property now has everything needed to update each rule.
This step contains the bulk of the effort required to migrate to the Web SDK, and requires knowledge of how your implementation works. An example is provided below as an example of how to edit a typical tag rule. Update all tag rules in your implementation to replace all references to the Adobe Analytics extension with the Web SDK extension.
-
In the left navigation of the tags interface, select Rules.
-
Select a rule to edit.
-
Select the action Adobe Analytics - Set Variables
-
Note all Analytics variables set within this rule. Include both variables set in the drop-down menus and variables set within custom code.
-
Change the Action Configuration to the following settings:
- Extension: Adobe Experience Platform Web SDK
- Action type: Update variable
-
Ensure that your data object is selected in the drop-down on the right.
-
Set the Analytics variables to their same respective values as they were configured in the Analytics extension.
- Variables set within the tags interface can directly translate to the same values.
- String variables set within custom code require minimal adjustments. Instead of using the
s
object, usedata.__adobe.analytics
instead. For example,s.eVar1
would translate todata.__adobe.analytics.eVar1
. - Analytics configuration variables and method calls in custom code can require modified implementation logic. See each respective variable to determine how to achieve its equivalent using the Web SDK.
-
Once all rule logic is replicated using the Web SDK extension, select Keep Changes.
-
Repeat these steps for every action configuration that uses the Adobe Analytics extension to set values. This step includes both variables set using the tags interface and variables set using custom code. Custom code blocks cannot reference the
s
object anywhere.
The above steps apply only to rules that set values. The following steps replace all actions that use the Action Configuration Send Beacon.
-
Select a rule that sends a beacon.
-
Select the action Adobe Analytics - Send Beacon.
-
Note the current value of the Tracking radio button on the right (
s.t()
ors.tl()
). -
Change the Action Configuration to the following settings:
- Extension: Adobe Experience Platform Web SDK
- Action type: Send event
-
On the right, change the action settings to the following:
-
Type: For
s.t()
, use Web Webpagedetails Page Views. Fors.tl()
, use Web Webinteraction Link Clicks. If you uses.tl()
, you must also include the following fields in your data object. These fields are listed under Additional properties when performing the Update variable action configuration:
-
-
Select Keep Changes.
-
Repeat these steps for every action configuration that uses Adobe Analytics to send a beacon.
Publishing updated rules follows the same workflow as any other change to your tags configuration.
- In the left navigation of the tags interface, select Publishing Flow.
- Select Add Library.
- Give this tag commit a name, such as “Upgrade to Web SDK”.
- Select Add All Changed Resources.
- Select Save.
- The publishing workflow displays an orange dot, indicating that it is building. Once the dot turns green, your changes are available in your development environment.
- Test your changes in your development environment to ensure that all rules are firing properly, and that the data object is populating with expected values.
- When ready, submit the library for approval, build to staging, then ultimately approve and publish to production.
Once your tag implementation is fully on the Web SDK, you can disable the Adobe Analytics extension.
- In the left navigation of the tags interface, select Extensions.
- Locate and select the Adobe Analytics extension. On the right, select Disable.
- Follow the same publishing workflow above to publish the removal of the Adobe Analytics extension.
- Once the extension is disabled in production, you can uninstall it entirely. Select the extension, select the three-dot menu on the right, then select Uninstall.
- Follow the same publishing workflow above to publish those changes to production.
At this point, your Analytics implementation is fully on the Web SDK and is adequately prepared to move to Customer Journey Analytics in the future.