May 26, 2020
Estimated Post Reading Time ~

AEM-DTM-Target Integration. Simplified! – Part1

AEM-DTM-Target integration takes advantage of the tremendous extensibility of AEM. The primary aim is to integrate AEM with Adobe Target to enable the creation and delivery of personalized experiences for specific audiences. However, using DTM as a technology bridge will facilitate the integration of AEM with Target.

Let’s start by introducing the three solutions in Adobe Experience Cloud.
AEM – Adobe Experience Manager (AEM) is a web content management system with powerful features to manage, organize, and deliver enterprise content with a best-in-class experience. AEM came to Adobe with the acquisition of Day Software in 2010, earlier it was known as Day CQ (Communique). For this article, we are using the AEM 6.3 version.

DTM – Dynamic Tag Management(DTM) is a solution that offers tools to integrate Adobe Experience Cloud solutions as well as third-party solutions like Google Analytics etc. DTM used to be known as ‘Satellite’ before Adobe acquired it in 2013.
Target – Adobe Target is a personalization solution of the Adobe Experience Cloud suite, which delivers the personalization of content based on different types of rules. Target came to Adobe with the acquisition of Omniture in 2009. In this article, we are going to demonstrate the Target VEC (Visual Enhanced Composer) capabilities.

Architecture:
AEM can be integrated with Target directly without using DTM. However, it’s recommended to use DTM in between due to the listed benefits:
Efficiency –DTM allows you to optimize the loading time of multiple tools and marketing tags.
Reduced Cost – Minimise the development cost as once Data Layer is in place multiple solutions can leverage the same.
Flexibility – DTM allows you to quickly test and optimize tags without being bound by release cycles.
Multiple Sites – Using DTM you can manage multiple sites from a single console.

AEM is usually connected with DTM using AEM Cloud Services and Target is connected to DTM using Experience Cloud configuration. Here is the relevant diagram for AEM-DTM-Target integration.

Request Flow for AEM-DTM-Target Integration:

How a request flows from AEM to Target via DTM:
AEM starts rendering a site page.
The site has a DTM script attached along with Data Layer. DTM script is associated with a relevant property. Data Layer is discussed below.
DTM Property has Target added to it, which raises a request to Target and share the required data.
Target pushes its response back to the AEM instance using mbox.js. Note: Now mbox.js has a newer and updated alternative which is known as at.js
AEM page got Target response which gets rendered on the page.
Fig: Diagram of the request flow in AEM-DTM-Target Integration.

Data Layer:
As you might have noticed in the request flow the AEM site has got the DTM Script and Data Layer associated. The data layer is a W3C standard to store values in javascript objects. The data layer is created at AEM and consumed by DTM to get the required data from the AEM instances and push it to any solution like Analytics, Target, etc. We are going to create a sample data layer below in the DTM Rules section.

DTM Setup:
To get access to DTM, one has to raise the request with Adobe Client Care with proper information. Once the access is granted, go to https://dtm.adobe.com and log in with the credentials provisioned by Client Care.

To start with DTM, create a new property with the URL of the website. Thereafter add the required tools in the property like Adobe Analytics or Adobe Target. In AEM configuration, we are going to use the same DTM Property in order to integrate the AEM with Analytics, Target, etc.

For this article, we are going to add Adobe Target as we need to carry out AEM-DTM-Target integration. To do this, we need Client Code which will be provided by Client Care, or alternatively, you can try adding using Experience Cloud membership.
Fig: DTM property creation.
Fig: Addition of relevant tool or solution to DTM property.

Fig: Adding Target as a tool in DTM property.

DTM Rules:
In the above steps, you have created a new DTM property and added Target as a tool in the same property. Now you need to know how to play with data, DTM uses the data layer to get the data from the AEM instances. For example, using Target you need to render the homepage of your website based on the browser, location, devices, etc or you can also get user-specific details like age, gender, interests, etc. Hence you need to get all such information from AEM in the data layer. 

For example, here is the data layer:
var dataLayer = {} dataLayer.page = { pageInfo: { pageName: document.title, url: document.location } }

Once the data-layer is all set, fetch the values from the data layer and set it in DTM data elements. We use these data elements in different types of rules. DTM has got three types of rules:
1. Event-Based Rule – Rules executed when a visitor interacts with on-page elements.
2. Page Load Rule – Rules executed when a visitor loads the page.
3. Direct Call Rule – Rules executed when you want to tell DTM to do something specifically.
Fig: DTM Rules

Creating a data element using the data layer is quite straightforward. You can see the below screenshot, here we have created a new data element Page Title which is mapped with the pageName field of the data layer created above.


Fig: Data Elements

DTM Workflow:
Every property in DTM follows a standard workflow. Workflow has got three steps:
Creation of property and rules.
Approve the newly added and modified rules.
Publish the property to make the changes live.

AEM-DTM Integration:
There are two ways to integrate DTM with AEM:

Using Cloud Services
Embed JS

Using Cloud Services:
Using the AEM admin console, go to Tools > Deployment > Cloud Services. Find ‘Dynamic Tag Management and click on ‘Configure now’. Provide a Title and Name of the configuration keeping the Parent Configuration field intact. Enter the details below:
Property
Description
API Token
The value of the API Token property of your Dynamic Tag Management user account. AEM uses this property to authenticate with Dynamic Tag Management.
Company
The company with which your login ID is associated.
Property
The name of the Web Property that you created for managing the tags for your AEM site.
Include Production Code on Author
Select this option to cause the AEM author and publish instances to use the production version of the Dynamic Tag Management libraries.
When this option is not selected, the Staging Settings apply to the author instance, and the Production Settings apply to the publish instance.

There is an option to self-host the DTM libraries which means AEM will host the DTM libraries if this option is checked, if we want to use the libraries from the cloud then we should uncheck this option. Here we are using a later one.
Embed JS:

Go to the DTM Console using https://dtm.adobe.com and click on the relevant property.
Go to the Embed tab, copy the Header and Footer staging script, go to the AEM author instance and copy the script in the header and footer of the website respectively. Similarly, copy the header and footer production script and put it in the AEM publish instance.

Let’s say you have integrated DTM with AEM using one of the above-mentioned methods, and assign the DTM config to the root of your site using AEM Sites console.
DTM-AEM Connection Test:

Now you need to test whether the DTM script is getting loaded with your website. In the browser, try to open any page of your website where you have assigned the DTM config and open the browser console. If the “_satellite” object exists then it means the DTM script is getting loaded. You can also try retrieving the data elements that you have created in DTM using “_satellite.dataElements”. If you are able to find all the details, you are good to go.

If the _satellite object doesn’t exist, it means the page doesn’t have the DTM header/footer script. You can view the source of the page to confirm the same.


Fig: Satellite Object


Fig: Satellite Data Elements

DTM Debugging Tools:
In DTM we play with different types of scenarios and scripts, hence we might need to check if the scripts are working fine and in order, they are getting executed.
There are a couple of browser plugins that proved to be quite useful for debugging.

Launch Switch:
It enables the logging into the console and as well as we can test the changes using a staging script, before making the changes live.

There are two buttons available on the plugin console. Tweaking them will do the following:
Debug: It enables the logging of the rules, you can also add the logs using _satellite.notify(“info”).
Staging: It will enable the changes you have made in the property that you have not published. This is used for testing the changes before making them live.

Download URL for Chrome: https://chrome.google.com/webstore/detail/launch-and-dtm-switch/nlgdemkdapolikbjimjajpmonpbpmipk
Fig: Launch Switch Plugin.

Tagtician:
It shows detailed information about all the DTM Rules.
Download URL Chrome: https://chrome.google.com/webstore/detail/tagtician-for-adobe-dtm/hiaoiehpkillodoeillmodjcadmfmcbg
Fig: All the DTM rules detailed in Tagtician.

Reference:
Adobe DTM Documentation: https://marketing.adobe.com/resources/help/en_US/dtm/

This is the first part of “AEM-DTM-Target Integration. Simplified!” where you have learned how to set up DTM, create DTM property and data elements, integrate DTM with AEM, and debug DTM. In Part 2, you will learn how to create different types of rules in DTM, use these rules to share the information to Target, Target activities, Target audience, and how to use Target VEC (Visual Enhanced Composer) along with the Target debugging tweaks.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.