dataLayer snippet and variable access in Tealium

Bronze Contributor
Bronze Contributor
#tealium #dataLayer
Hi everyone, I am preparing dataLayer spec for a client and I have 2 questions as they use Tealium.
  1. If we want to render a dL object (on page view event)  and have access to the values, should dL snippet be placed in the <head> above Tealium snippet? Logically speaking... it should works exactly like in GTM-dL case..?
  2. As I see in Tealium doc, object pushed to dL should be visible in Tealium. But what's next?
I assume I will be able to access this object's values somehow (using js objectName.propertyName?) in Tealium interface?

Thanks in advance!
 
tealium events.png
2 REPLIES 2

dataLayer snippet and variable access in Tealium

Tealium Employee

Hi @PawelAntoniak 

 

2021-11-13_10h26_19.png

I'm slightly confused with "<head> above Tealium snippet?".

Following the document: https://docs.tealium.com/platforms/google-tag-manager/install/, it should all be done in GTM.

If the expectations is to track a "page_load" event you might want to consider adding a new event to the dataLayer array after its available. Following the GTM documentation:

here's an example:

 

<head>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <!--Google Tag Manager-->
        <script>
            var dataLayer = dataLayer || [];

            (function (w, d, s, l, i) {w[l] = w[l] || []; w[l].push({'gtm.start':
            new Date().getTime(), event: 'gtm.js'});var f = d.getElementsByTagName(s)[0],
            j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src='https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
            })(window, document, 'script', 'dataLayer', 'GTM-******');
            
            dataLayer.push({
                event           : "page_load",  
                page_name       : "main",
                page_category   : "generic",
                authenticated   : false
            });

 

2021-11-13_10h42_22.png

 

Thats correct, if the client side Collect Tag installation in GTM was successful, it should now be possible to see the event with its payload arriving in Tealium's CDH.

Live Events: 

Next steps are based on Use Case requirements:

 

 

 

 

 

 

 

dataLayer snippet and variable access in Tealium

Bronze Contributor
Bronze Contributor

I have the Tealium Collect Tag and the Tealium Data Enrichment Tag installed into GTM.  When the page loads, there is an "i.gif" with a payload of the page load data.  The event name sent to EventStream is "gtm.js".

However, that is the only event I can get to show up in EventStream.  If I push that "test_number" event to the dataLayer, I do not see i.gif and because of that, I do not see anything in EventStream.  What am I doing wrong?  From what I understood, any pushes to the dataLayer that have an event defined should automatically trigger sending another i.gif

Public