screenshot_8

Dynamic Tag Manager provides you a great level of control in terms of how third party scripts can be added to your website.  Being able to control this can be very important as there are times where your vendor may require code to be placed strategically on your site in order for it to work correctly.

The problem with this flexibility is that it can be very confusing for the average user trying to choose which configurations to use.  The other problem is that your change could impact performance as you may end up adding to the load time or even worse; rendering the website unusable.

This article will help to explain the various settings that you will encounter, and provide examples of when to use each setting. I will also outline the common ‘gotchas’ associated with adding scripts.

Step 1: Define Trigger Rule

Before we dive in, let’s take some time to understand the various trigger rules in which DTM executes the load rule. The following outlines the four conditions in firing order:

screenshot_2

 

Top of Page

“Top of Page” conditions will fire as soon as DTM is loaded. This will typically be fired as the is rendering.  This is assuming that you have the “header code” installed as per the recommendation. At this point of the page lifecycle, there is no content rendered in the page such as links or images.  

A very common need to load scripts here is when you need to load a script that loads before content, as an example, you would use this rule to install “Optimizely” to avoid the page flicker resulting from the dynamic switching of content.

Exercise caution when installing HTML code such as AdWords conversion pixels: you should not render HTML elements such as or

, only tags that are allowed between tags such as.

Bottom of Page

Bottom of Page fires next when “_satellite.pageBottom()” is called, so, it’s very important that the developer installs this right before the end tag after all of the code.  Typically, when this trigger fires, you would be confident that all of the HTML has been loaded into the document.  Things like external files including images, JavaScript, and CSS is likely still loading in the background.

This is the common rule where users add their tags due to the content being ready for manipulation.

Dom Ready

Dom ready is triggered when the HTML has finished loading, this guarantee that the loaded content is ready to be interacted with.  A practical use is when you are wanting to write jQuery logic to listen for interactions with your content.  You may notice that “Dom Ready” fires instantly after “Bottom of Page” simply due to the placement of the pageBottom() code.  

This is a safer balance to strike between speed and usability when it comes to adding your advertising pixels such as Adwords or Floodlight tags. This means that the scripts fire as soon as possible, while making sure the functionality of the website is not disrupted.  

Onload

Onload is triggered when both the HTML and dependent files include images and JavaScript.  This is the least favorite as it is the very last trigger to fire and normally you would like to see your script fire sooner.

Step 2: Define Script Type

Once you define when the code is triggered, you will then need to define the type of Script to install.

screenshot_3

Sequential JavaScript

Sequential JavaScript is similar to inserting your custom code as an external

Message Sent

Thank you for registering.

Cardinal Path hosted a live session to connect with you and answer all your questions on Google Analytics.
Get all the expertise and none of the consultancy fees in this not-to-be-missed, rapid-fire virtual event.

Thank you for submitting the form.

Thank you for submitting the form.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you.

Click here to download access the tool.

Message Sent

Thank you for registering.

Message Sent

Thank you.

Message Sent

Thank you.

Message Sent

Thank you

Message Sent

Thank you

Message Sent

Thank you.

Message Sent

Thank you

Message Sent

Thank you.

Message Sent

Success!
Your message was received.

Thank you.

Thank you for registering.

Cardinal Path is continuing with its series of free training. Next we are conducting training on Google Data Studio. Check it out here.

Message Sent

Thank you for registering.

Thank you for your submission.

Your request has been submitted and a rep will reach out to you shortly.

Message Sent

Thank you for your interest.

Thank you for registering.

You should receive a confirmation email from GoToWebinar with your unique webinar login information. If you do not receive this email or have trouble logging in to the event, please email asmaa.mourad@cardinalpath.com.

Thank you for subscribing!

You're now looped into the world's largest GMP resource hub!

Thank you for your submission.

Thank you for your submission.

Thank you for your submission.

Thank you for your submission.

Message Sent

Thank you for registering.

Message Sent

Thank you for your submission.

Thank you for your submission.

Message Sent

Thank you for registering.

Thank you for registering.​

Paid media spend by Government websites increased a whopping 139% YoY in 2020.

2020 Online Behavior Live Dashboard

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

2020 Online Behavior Live Dashboard

Thank you for your submission.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Success! Thank you
for reaching out.