Set up Adobe Analytics with Adobe Experience Platform Web SDK
Learn how to set up Adobe Analytics using Adobe Experience Platform Web SDK, create tag rules to send data to Adobe Analytics, and validate that Analytics is capturing data as expected.
Adobe Analytics is an industry-leading application that empowers you to understand your customers as people and steer your business with customer intelligence.
Learning objectives
At the end of this lesson, you will be able to:
- Configure a datastream to enable Adobe Analytics
- Know which standard XDM fields auto-map to Analytics variables
- Set custom Analytics variables using the Adobe Analytics ExperienceEvent Template field group or processing rules
- Send data to another report suite by overriding the datastream
- Validate Adobe Analytics variables using Debugger and Assurance
Prerequisites
To complete this lesson, you must first:
-
Be familiar with and have access to Adobe Analytics.
-
Have at least one test/dev report suite ID. If you don’t have a test/dev report suite that you can use for this tutorial, please create one.
-
Complete the earlier lessons in the Initial Configuration and Tags Configuration sections of this tutorial.
Configure the datastream
Platform Web SDK sends data from your website to Platform Edge Network. Your datastream then tells Platform Edge Network to which Adobe Analytics report suites your data should be sent.
-
Go to Data Collection interface
-
On the left navigation, select Datastreams
-
Select the previously created
Luma Web SDK: Development Environment
datastream -
Select Add Service
-
Select Adobe Analytics as the Service
-
Enter the Report Suite ID of your development report suite
-
Select Save
note tip TIP Adding more report suites by selecting Add Report Suite is equivalent to multi-suite tagging.
XDM schemas and Analytics variables
Congratulations! You have already configured a schema compatible with Adobe Analytics in the Configure a schema lesson!
But you might be wondering, how do I set all my props, evars and events?
There are several approaches, which can be used simultaneously:
- Set standard XDM fields and some will automatically map to Analytics variables.
- Map additional XDM fields to Analytics variables in Analytics processing rules.
- Map to Analytics variables directly in the XDM schema.
Automatically mapped fields
Many XDM fields are automatically mapped to Analytics variables.
The schema created in the Configure a schema lesson contains a few auto-mapped to Analytics variables, as outlined in this table:
identitymap.ecid.[0].id
web.webPageDetails.name
web.webPageDetails.server
web.webPageDetails.siteSection
commerce.productViews.value
commerce.productListViews.value
commerce.checkouts.value
commerce.purchases.value
commerce.order.currencyCode
commerce.order.purchaseID
productListItems[].SKU
productListItems[].name
productListItems[].quantity
productListItems[].priceTotal
The individual sections of the Analytics product string are set through different XDM variables under the productListItems
object.
As of August 18, 2022,
productListItems[].SKU
takes priority for mapping to the product name in the s.products variable.
The value set toproductListItems[].name
is mapped to the product name only ifproductListItems[].SKU
does not exist. Otherwise, it is unmapped and available in context data.
Do not set an empty string or null toproductListItems[].SKU
. This has the undesired effect of mapping to the product name in the s.products variable.
For the most up-to-date list of mappings, please see Analytics variable mapping in Adobe Experience Edge.
Map to Analytics variables with processing rules
All fields in the XDM schema become available to Adobe Analytics as Context Data Variables with the following prefix a.x.
. For example, a.x.web.webinteraction.region
In this exercise, you map one XDM variable to a prop. Follow these same steps for any custom mapping that you must do for any eVar
, prop
, event
, or variable accessible via Processing Rules.
-
Go to the Analytics interface
-
Go to Admin > Admin Tools > Report Suites
-
Select the dev/test report suite that you are using for the tutorial > Edit Settings > General > Processing Rules
-
Create a rule to Overwrite value of
Product SKU (prop1)
toa.x.productlistitems.0.sku
. Remember to add a note about why you are creating the rule and name your rule title. Select Savenote important IMPORTANT The first time you map to a processing rule, the UI does not show you the context data variables from the XDM object. To fix that select any value, Save, and come back to edit. All XDM variables should now appear.
Map to Analytics variables using the Adobe Analytics field group
An alternative to processing rules is to map to Analytics variables in the XDM schema using the Adobe Analytics ExperienceEvent Template
field group. This approach has gained popularity because many users find it simpler than configuring processing rules, however, by increasing the size of the XDM payload it could in turn increase the profile size in other applications like Real-Time CDP.
To add the Adobe Analytics ExperienceEvent Template
field group to your schema:
- Open the Data Collection interface
- Select Schemas from the left navigation
- Make sure you are in the sandbox you are using from the tutorial
- Open your
Luma Web Event Data
schema - In the Field Groups section, select Add
- Find the
Adobe Analytics ExperienceEvent Template
field group and add it to your schema
Now, set a merchandising eVar in the product string. With the Adobe Analytics ExperienceEvent Template
field group, you are able to map variables to merchandising eVars or events within the product string. This is also known as setting Product Syntax Merchandising.
-
Go back to your tag property
-
Open the rule
ecommerce - library loaded - set product details variables - 20
-
Open the Set Variable action
-
Select to open
_experience > analytics > customDimensions > eVars > eVar1
-
Set the Value to
%product.productInfo.title%
-
Select Keep Changes
-
Select Save to save the rule
As you just saw, basically all of the Analytics variables can be set in the Adobe Analytics ExperienceEvent Template
field group.
_experience
object under productListItems
> Item 1
. Setting any variable under this object sets Product Syntax eVars or Events.Send data to a different report suite
You might want to change which Adobe Analytics report suite data is sent to when visitors are on certain pages. This requires a configuration in both the datastream and a rule.
Configure the datastream for a report suite override
To configure the Adobe Analytics report suite override setting in the datastream:
-
Open your datastream
-
Edit the Adobe Analytics configuration by opening the menu and then selecting Edit
-
Select the Advance Options to open Report Suite Overrides
-
Select the report suites that you would like to override. In this case,
Web SDK Course Dev
andWeb SDK Course Stg
-
Select Save
Configure a rule for a report suite override
Let’s create a rule to send an additional page view call to a different report suite. Use the datastream override feature to change the report suite for a page using the Send Event Action.
-
Create a new rule, name it
homepage - library loaded - AA report suite override - 51
-
Select the plus sign under Event to add a new trigger
-
Under Extension, select Core
-
Under Event Type, select library loaded
-
Select to open Advanced Options, type in
51
. This ensures the rule runs after theall pages - library loaded - send event - 50
that sets the baseline XDM with the Update variable action type. -
Under Conditions, select to Add
-
Leave Logic Type as Regular
-
Leave Extensions as Core
-
Select Condition Type as Path Without Query String
-
On the right, leave the Regex toggle disabled
-
Under path equals set
/content/luma/us/en.html
. For the Luma demo site, it ensures the rule only triggers on the home page -
Select Keep Changes
-
Under Actions select Add
-
As the Extension, select Adobe Experience Platform Web SDK
-
As the Action Type, select Send Event
-
As the Type, select
web.webpagedetails.pageViews
-
As the XDM data, select the
xdm.variable.content
data element you created in the Create data elements lesson -
Scroll down to the Datastream Configurations Overrides section
-
Leave the Development tab selected.
note tip TIP This tab determines in which tags environment the override occurs. For this excerise, you only specify the Development environment but when you deploy this to production remember to also do it in the Production environment. -
Select the Datastream, in this case
Luma Web SDK: Development Environment
-
Under Report suites, select the report site you would like to use to override for. In this case,
tmd-websdk-course-stg
. -
Select Keep Changes
-
And Save your rule
Build your Development environment
Add your new data elements and rules to your Luma Web SDK Tutorial
tag library and rebuild your development environment.
Congratulations! The next step is to validate your Adobe Analytics Implementation via Experience Platform Web SDK.
Validate Adobe Analytics with Debugger
Learn how to validate that Adobe Analytics is capturing the ECID, page views, the product string, and e-commerce events with the Edge Trace feature of the Experience Platform Debugger.
In the Debugger lesson, you learned how to inspect the client-side XDM request with the Platform Debugger and browser developer console, which is similar to how you debug an AppMeasurement.js
Analytics implementation. You also learned about validating Platform Edge Network server-side requests sent to Adobe applications, and how to view a fully processed payload using Assurance.
To validate Analytics is capturing data properly through Experience Platform Web SDK, you must go two steps further to:
- Validate how data is processed by the XDM object on the Platform Edge Network, using Experience Platform Debugger’s Edge Trace feature
- Validate how data is fully processed by Analytics using Adobe Experience Platform Assurance
Experience Cloud ID validation
-
Go to the Luma demo site
-
Select the login button on the top right, and use credentials u: test@adobe.com p: test to authenticate
-
Open the Experience Platform Debugger and switch the tag property on the site to your own development property
-
To enable the Edge Trace, go to Experience Platform Debugger, in the left navigation select Logs, then select the Edge tab, and select Connect
-
It will be empty for now
-
Refresh the Luma page and check Experience Platform Debugger again, you should see data come through. The row starting with Analytics Automatic Mapping is the Adobe Analytics beacon
-
Select to open both the
mappedQueryParams
dropdown and the second dropdown to view Analytics variablesnote tip TIP The second dropdown corresponds to the Analytics report suite ID you are sending data to. It should match your own report suite, not the one in the screenshot. -
Scroll down to find
c.a.x.identitymap.ecid.[0].id
. It is a Context Data Variable that captures ECID -
Keep scrolling down until you see the Analytics
mid
variable. Both IDs match with your device’s Experience Cloud ID. -
On the Luma site,
note note NOTE Since you are logged in, take a moment to validate the authenticated ID 112ca06ed53d3db37e4cea49cc45b71e
for the usertest@adobe.com
is captured as well in thec.a.x.identitymap.lumacrmid.[0].id
Report suite override validation
Above you configured a datastream override for the Luma homepage. To validate this configuration
-
Look for a row with Datastream config after override was applied. Here you find the primary report suite and the additional report suite(s) that were configured for the report suite overrides.
-
Scroll down to the row starting with Analytics Automatic Mapping and verify that the
reportSuiteIds
shows the report suite you specified in your override configurations
Content page views validation
Go to a product page like the Didi Sport Watch product page. Validate that content page views are captured by Analytics.
-
Look for
c.a.x.web.webpagedetails.pageviews.value=1
. -
Scroll down to see the
gn
variable. It is the Analytics dynamic syntax for thes.pageName
variable. It captures the page name from the data layer.
Product string and e-commerce events validation
Since you are already on a product page, this exercise continues to use the same Edge Trace to validate product data is captured by Analytics. Both the product string and e-commerce events are automatically mapped XDM variables to Analytics. As long as you have mapped to the proper productListItem
XDM variable while configuring an XDM schema for Adobe Analytics, the Platform Edge Network takes care of mapping the data to the proper analytics variables.
First validate that the Product String
is set
-
Look for
c.a.x.productlistitems.[0].sku
. The variable captures the data element value you mapped to theproductListItems.item1.sku
earlier in this lesson -
Also look for
c.a.x.productlistitems.[0]._experience.analytics.customdimensions.evars.evar1
. The variable captures the data element value you mapped toproductListItems.item1._experience.analytics.customdimensions.evars.evar1
-
Scroll down to see the
pl
variable. It is the dynamic syntax of the Analytics product string variable -
Note that product name from the data layer is mapped both to the
c.a.x.productlistitems.[0].sku
and theproduct
parameter of the products string. In addition, the product title from the data layer is mapped to merchandising evar1 in the products string.The Edge Trace treats
commerce
events slightly differently thanproductList
dimensions. You do not see a Context Data Variable mapped the same way you see the product name mapped toc.a.x.productlistitem.[0].name
above. Instead, the Edge Trace shows the final event auto-mapping in the Analyticsevent
variable. Platform Edge Network maps it accordingly as long as you map to the proper XDMcommerce
variable while configuring the schema for Adobe Analytics; in this case thecommerce.productViews.value=1
. -
Back on the Experience Platform Debugger window, scroll down to the
events
variable, it is set toprodView
-
Also note
c.a.x.eventType
is set tocommerce.productViews
since you are on a product page.note tip TIP The ecommerce - pdp library loaded - AA (order 20)
rule is overwriting the value ofeventType
set by theall pages global content variables - library loaded - AA (order 1)
rule as it is set to trigger later in the sequence
Validate the rest of e-commerce events and product strings are set for Analytics
-
Add Didi Sport Watch to cart
-
Go to the Cart Page, check Edge Trace for
eventType
set tocommerce.productListViews
events: "scView"
, and- the product string is set
-
Proceed to checkout, check Edge Trace for
eventType
set tocommerce.checkouts
events: "scCheckout"
, and- the product string is set
-
Fill out just the First Name and Last Name fields on the shipping form and select Continue. On the next page, select Place Order
-
On confirmation page, check Edge Trace for
eventType
set tocommerce.purchases
- Purchase event being set
events: "purchase"
- Currency Code variable being set
cc: "USD"
- Purchase ID being set in
pi
- Product string
pl
setting the product name, quantity, and price
Validate Adobe Analytics using Assurance
Adobe Experience Platform Assurance helps you inspect, proof, simulate, and validate how you collect data or serve experiences with your website and mobile application.
In the previous exercise you validated that Adobe Analytics is capturing the ECID, page views, the product string, and e-commerce events with the Edge Trace feature of the Experience Platform Debugger. Next you validate those same events using Adobe Experience Platform Assurance, an alternative interface to access the same data in Edge Trace.
As you learned in the Assurance lesson, there are several ways to initiate an Assurance session. Since you already have Adobe Experience Platform Debugger open with an Edge Trace session initiated from the last exercise, we recommend accessing Assurance through the Debugger:
Within the “Web SDK Tutorial 3” Assurance Session enter “hitdebugger” into the Events Search Bar to filter the results to the Adobe Analytics Post Processed data.
Experience Cloud ID validation
To validate Adobe Analytics is capturing the ECID, select a beacon and open the Payload. The Vendor for this beacon should be com.adobe.analytics.hitdebugger
Then scroll down to mcvisId to validate that the ECID is correctly captured
Content page views validation
Using the same beacon, validate that content page views are mapped to the correct Adobe Analytics variable.
Scroll down to pageName to validate that the Page Name
is correctly captured
Product string and e-commerce events validation
Following the same validation use cases used when validating with the Experience Platform Debugger above, continue using the same beacon to validate the Ecommerce Events
and the Product String
.
- Look for payload where the events contain
prodView
- Scroll down to product-string to validate the
Product String
.- Note the
Product SKU
andMerchandizing eVar1
.
- Note the
- Scroll down further and validate that
prop1
, which you configured using processing rules in the previous section, contains theProduct SKU
Continue to validate your implementation by reviewing the cart, checkout, and purchase events.
- Look for payload where the events contain
scView
and validate the product string.
- Look for payload where the events contain
scCheckout
and validate the product string.
- Look for payload where the events contain
purchase
- When validating the
purchase
event, note that theProduct String
should contain theProduct SKU
,Product Quantity
, andProduct Total Price
. - In addition, for the
purchase
validate that thepurchase-id
and/orpurchaseId
are set
Congratulations! You did it! This is the end of the lesson and now you are ready to implement Adobe Analytics with Platform Web SDK for your own website.
Next: Add Adobe Audience Manager