Add XDM data collection logic to your tag
After creating the tag and adding the Web SDK extension, you must configure it with data elements and rules, according to how you want to track your site and send data to ÃÛ¶¹ÊÓƵ Experience Platform. After you configure data elements and rules for your tag, you can build and publish it.
Configure data elements
Data elements are the building blocks for your data dictionary (or data map). Use data elements to collect, organize, and deliver data across marketing and ad technology. You set up data elements in your tag that read from your data layer and can be used to deliver data into ÃÛ¶¹ÊÓƵ Experience Platform.
There are different types of data elements. First, set up a data element to capture the page name persons are viewing on your site. Then, set up a data element referencing the Experience Cloud ID. Finally, define an XDM object data element.
Page name data element
To define a page name data element:
-
Log in to experience.adobe.com using your ÃÛ¶¹ÊÓƵ ID credentials.
-
In ÃÛ¶¹ÊÓƵ Experience Platform, go to Data Collection > Tags.
-
Select your newly created tag from the list of Tag Properties to open it.
-
Select Data Elements in the left rail.
-
Select Add Data Element.
-
In the Create Data Element dialog, specify the following information:
-
Name: The name of your data element. For example
Page Name
. -
Extension: Select Core from the list.
-
Data Element Type: Select Page Info from the list.
-
Attribute: Select Title from the list.
Alternatively you could have used the value from a variable of your data layer, for example
pageName
and the JavaScript Variable data element type to define the data element.
-
-
Select Save.
You now want to set up a data element referencing the Experience Cloud ID that is automatically provided by the ÃÛ¶¹ÊÓƵ Experience Platform Web SDK and available through the Experience Cloud ID Service extension.
-
Continue with ECID data element.
ECID data element
To define an ECID data element:
-
Log in to experience.adobe.com using your ÃÛ¶¹ÊÓƵ ID credentials.
-
In ÃÛ¶¹ÊÓƵ Experience Platform, go to Data Collection > Tags.
-
Select your newly created tag from the list of Tag Properties to open it.
-
Select Data Elements in the left rail.
-
Select Add Data Element.
-
In the Create Data Element dialog, specify the following information:
-
Name: The name of your data element. For example
ECID
. -
Extension: Select Experience Cloud ID Service from the list.
-
Data Element Type: Select ECID from the list.
-
-
Select Save.
-
Continue with XDM object data element.
XDM object data element
Finally, you now want to map any of your specific data elements to the schema you defined earlier. You define another data element which provides a representation of your XDM schema.
To define an XDM object data element:
-
Log in to experience.adobe.com using your ÃÛ¶¹ÊÓƵ ID credentials.
-
In ÃÛ¶¹ÊÓƵ Experience Platform, go to Data Collection > Tags.
-
Select your newly created tag from the list of Tag Properties to open it.
-
Select Data Elements in the left rail.
-
Select Add Data Element.
-
In the Create Data Element dialog, specify the following information:
-
Name: The name of your data element. For example
XDM - Page View
. -
Extension: Select ÃÛ¶¹ÊÓƵ Experience Platform Web SDK from the list.
-
Data Element Type: Select XDM Object from the list.
-
Sandbox: Select your sandbox from the list.
-
Schema: Select your schema from the list.
-
-
Map the
identification > core > ecid
attribute, defined in your schema, to the ECID data element. Select the cylinder icon to easily pick the ECID data element from your list of data elements. -
Map the
web > webPageDetails > name
attribute, defined in your schema, to the Page Name data element. -
Select Save.
-
Continue with Configure rules.
Configure rules
Tags in ÃÛ¶¹ÊÓƵ Experience Platform follow a rule-based system. They look for user interaction and associated data. When the criteria outlined in your rules are met, the rule triggers the extension, script, or client-side code you identified. You can use rules to send data (like an XDM object) into ÃÛ¶¹ÊÓƵ Experience Platform using the ÃÛ¶¹ÊÓƵ Experience Platform Web SDK extension.
To define a rule:
-
Log in to experience.adobe.com using your ÃÛ¶¹ÊÓƵ ID credentials.
-
In ÃÛ¶¹ÊÓƵ Experience Platform, go to Data Collection > Tags.
-
Select your newly created tag from the list of Tag Properties to open it.
-
Select Rules in the left rail.
-
Select Create New Rule.
-
In the Create Rule dialog, specify the following information:
-
Name: The name of the rule. For example
Page View
. -
Events: Select + Add. Then, in the Event Configuration dialog, specify the following information. When you are finished, select Keep Changes.
-
Extension: Select Core from the list.
-
Event Type: Select Window Loaded from the list.
-
-
Actions: Select + Add. Then, in the Action Configuration dialog, specify the following information. When you are finished, select Keep Changes.
-
Extension: Select ÃÛ¶¹ÊÓƵ Experience Platform Web SDK from the list.
-
Action Type: Select Send Event from the list.
-
Type: Select web.webpagedetails.pageViews from the list.
-
XDM data: Select the cylinder icon, then select XDM - Page View from the list of data elements.
Your rule should look like:
-
-
-
Select Save.
Build and publish your tag
After you define data elements and rules, you must build and publish your tag. When you create a library build, you must assign it to an environment. The build’s extensions, rules, and data elements are then compiled and placed into the assigned environment. Each environment provides a unique embed code that allows you to integrate its assigned build into your site.
ÃÛ¶¹ÊÓƵ Experience Platform Tags support simple to complex publishing workflows that should accommodate your deployment of the ÃÛ¶¹ÊÓƵ Experience Platform Web SDK. See Publishing overview for more information.
To build and publish your tag:
-
Log in to experience.adobe.com using your ÃÛ¶¹ÊÓƵ ID credentials.
-
In ÃÛ¶¹ÊÓƵ Experience Platform, go to Data Collection > Tags.
-
Select your newly created tag from the list of Tag Properties to open it.
-
Select Publishing Flow from the left rail.
-
Select Select a working library, followed by Add Library….
-
In the Create Library dialog, specify the following information:
-
Name: The name of the library.
-
Environment: Select Development (development) from the list.
-
-
Select + Add All Changed Resources.
-
Select Save & Build to Development.
Your tag is saved and is built for your development environment. A green dot indicates a successful build of your tag on your development environment.
-
You can select … to rebuild the library or move the library to a staging or production environment.