Complete the following tasks to work with Google Tag Manager (GTM) and Customer Data Platform (CDP):
S.No. | Task | Tag details |
---|---|---|
1 | CDP - Global is a default essential tag for GTM. | |
2 | CDP - Customer Object is a default essential tag for GTM. | |
3 | The following are the default primary tags for GTM:
The following are the custom sample tags for GTM:
|
Configuring the Acquia Global tag
CDP uses an encrypted layer with a bcrypt salted key. You must refresh this key daily to access and push payloads to the CDP API. You must add the encrypted layer to the global tag so that it can auto-create the bcrypt key before getting fired daily, each time a customer engages on a webpage where GTM is added.
In the GTM user interface, click Tags > New.
Name the tag as CDP - Global.
Click Tag Configuration.
In Choose tag type, click Custom HTML.
In HTML, create the Acquia encrypted layer script:
<script> var hashes = {"date": "bcrypt", "date"} var today = new Date().toISOstring().slice(0,10); var $A1Config = { key: hashes [today], tenantId: ADD ID, host: "Acquia API URL" }; </script> <script>src="https://scripts.agilone.com/latest/a1.js"</script>
In Advanced Settings:
Set Tag firing priority to 20.
Set Tag firing options to Once per page.
In Tag Sequencing:
Select the Fire a tag before CDP - Global fires checkbox.
In Setup Tag, select CDP - Customer Object so that the tag fires right before the CDP - Customer Object tag.
Click Triggering and set the triggering process to fire the tag at All Pages as Page View.
Click Save.
Configuring the Acquia Customer Object tag
In the GTM user interface, click Tags > New.
Name the tag as CDP - Customer Object.
Click Tag Configuration.
In Choose tag type, click Custom HTML.
In HTML, create the Acquia Customer Object script:
<script> var visitor = {"id" : "{{GA - ClientID}}"}; If ("{{GA - Data Layer - User Email}}" != "unknown") { visitor.email = "{{GA - Data Layer - User Email}}"; } var $a1vis = $A1.Customer(visitor); </script>
In Advanced Settings:
Set Tag firing priority to 10.
Set Tag firing options to Once per page.
In Tag Sequencing:
Select the Fire a tag before CDP - Global fires checkbox.
In Setup Tag, select the following tags so that the tag fires right before these tags:
CDP - Checkout
CDP - Login
CDP - PDP
CDP - PDP - Add to Cart
CDP - PLP
CDP - PLP - Add to Cart
CDP - Search
Click Triggering and set the triggering process to fire the tag at All Page Views - Window Loaded as Window Loaded.
Click Save.