Create a global page rule in Experience Platform tags
Learn how to set up a global page rule for data points you want to send to Adobe Analytics on every page using Experience Platform tags.
Transcript
In this video, I’ll show you how to create a global page load role in Experience Platform Tags. This is what I’ll cover. I’ll start by reviewing methods for setting global variables, followed by creating a new global page load role. I’ll additionally show you how to update your Solution Design Reference document. I have a tags property open. Before I show you how to create a role, we’ll review the configuration for the analytics extension. There’s a section for variables here. Now while you can use this interface to set variables that apply to all page views, it’s not Adobe’s best practice to do this here. Another section that you can potentially use is the Custom Code Editor. I’ve seen this done in implementations before, but really this should only be used for specific use cases. There’s another video on this topic if you’re interested in understanding more about it. The best way, and the Adobe preferred method, to send global variables to analytics is to use a tags role. There are a couple of reasons for this. First, you’ll have more control over when the rule executes. Second, it’s easier for multiple team members who use tags to find code in a uniform way. This tags property already contains a global page load role, but I’ll show you how to create one by adding a new role. I’ll select Add Rule in the top right. The first thing I’ll do is add a name for the role. Now I need to select an event. The default core extension is what gives me the different event types I can use. What I’m looking for is page load. There’s a few options, but I’ll choose DOM ready since the tags library is loaded asynchronously on the website. The last key detail to consider is the order of execution for this role compared to all of the other roles. This particular role should run after the other roles that set variables for special pages like search results, product pages, shopping carts. In other words, pages that set specific variables pertaining to only that type of page. I’m going to increase this to 60. I’ll select Keep Changes in the top right to continue configuring my role. I’ll add this order number to the role name so that I can easily understand the sequence across all roles. Now this isn’t something that applies to my global page load role because I want this role to execute for every page, but I will quickly discuss the conditions section of the role. As you can see this provides many different conditions you can choose from to provide more control over where the rule fires. For example, when I select cookie I can specify that a cookie containing a certain value be a condition to executing the role. All right now it’s time to configure the actions for the role. In sequence I first want to set analytics variables based on data elements and I want to send the beacon to Adobe servers. For extension I’ll select Adobe Analytics. This is because I’m going to configure the variables I want to set within this rule first. The action type is set variables. Once I select this the user interface to the right lets me set up specific EVARS, props, and events. Now I’m going to switch over to my solution design reference document. For props I’m using page name and site section. For EVARS I’m also setting EVAR3 and EVAR4 respectively for page name and site section as well. And in custom event, event 3 is used for a custom page view metric. Now back in my role I’ll configure the EVARS first. I’ll start with EVAR3. This should be set from the data element named page name. I’ll open my data elements in a new browser tab to verify the name though. There it is. Now in the set as text box I’ll enclose page name and percentage characters. This tells tags the value is coming from a data element. I’ll do the same thing for setting EVAR4 with the site section data element. Going down the list in order I’ll select the custom event for page views in the list box here. I don’t have to supply any additional details for this event. It’s in the additional settings area that I’ll find the reserved variables for things like page name and site section. I’ll configure those now just to note that site section aligns with the channel variable. Now I’ll select keep changes at the top. We’re not done yet. We still need to send the data to analytics. I’ll click on the plus sign next to set variables. I’m still working with the Adobe Analytics extension so I’ll select that. The action type is send beacon. Page view beacons use an s.t tracking call so I don’t need to make any changes here except select keep changes at the top. Now if I was going to save this rule I’d make sure build is selected then I’d select save to library and build but I’m going to cancel out of this since I already have a global page rule. Here it is in the list. Now I’ll go back to my solution design reference document and I’ll update the rule column for each of the variables that are set in the all pages rule. And that’s it. This concludes creating a global page load rule for analytics and tags and adding the details to the solution design reference document which is a best practice. Good luck!
recommendation-more-help
b5d9c99f-be9f-4b96-8809-4e7d6ae353ba