Tailwind Logo

How to send data to Sitecore CDP using Google Tag Manager

Customer Data Platform

Published: 2021-10-07

This year, the product from the CDP company we acquired will be released as Sitecore CDP. We'll introduce it on the blog using the CDP tag. This time, we'll cover the steps to insert the CDP tag via Google Tag Manager.

Content Update

Please check the latest information on the following page


Why use Google Tag Manager?

Many websites use Google Tag Manager, and although there are many other tag management tools available, this blog site also uses Google Tag Manager, so we will use it as a sample.

Integration with Tag Manager

First of all, please login to the Google Tag Manager administration site. For example, my site looks like this

gtm01.png

Click the New button.

gtm02.png

First, create a trigger. Click on Triggers at the bottom of the above screen.

gtm03.png

In this case, to create a trigger targeting DOM Ready, click the + in the upper right corner. Click on "Set Trigger" to switch to the following screen.

gtm04.png

Select DOM Ready at the top and name the trigger DOM Ready as well.

gtm05.png

Save the created trigger and return to the Create Tag screen.

gtm06.png

Select Tag Settings, Insert Custom HTML Tag.

gtm07.png

The input should be put in the following code as a reference. Of course, you will need to change it according to your environment and version.

JavaScript
<script>
    ( function() {
        window._boxever_settings = {
           client_key: "boxever5xx33zz44gggydzk",
           target: "https://api.boxever.com/v1.x",
           cookie_domain: "boxever.com",
           javascriptLibraryVersion: '1.4.X',
           pointOfSale: "boxever.com",
           web_flow_target: "https://abcdef.cloudfront.net" 
        }
        // load boxever.js
        var s = document.createElement('script');
        s.type = 'text/javascript';
        s.async = true;
        s.src = 'https://abcdef.cloudfront.net/boxever-' + window._boxever_settings.javaScriptLibraryVersion + '.mini.js';
        var x = document.getElementsByTagName('script')[0];
        x.parentNode.insertBefore(s, x);
    })();
</script>

The tag is named Sitecore CDP this time.

gtm08.png

This completes the preparation.

gtm09.png

Press the publish button to deploy the tag on the page.

gtm10.png

Operation check

When you actually go to refer to the source code, you will see that the following preconfigured contents have been added.

gtm11.png

Summary

When implementing Sitecore CDP, if you are already using Google Tag Manager or a similar tag management tool, you can embed tags into the pages of your site through tag management, rather than having to embed them into individual pages. Of course, it is also possible to insert tags through CMS integration, but it is easier to integrate with a tag management tool because Sitecore CDP's functions can be used for pages that are not managed by CMS.

Related article

Tags