Goal: A taglify.io server-side GTM container linked to your Google Tag Manager is configured and running.
Info |
---|
Summary of steps Note down your existing GTM Web Container Id Example: GTM-WHJ8FZC
Create a new Google sGTM container on tagmanager.google.com. Check the option “Manually provision tagging server”. Copy the Container Config String Example: aWQ9R1ABLVdISjlGWkMmZW52PTEmYXV0aD1VUzlrbVhlUWxtcElyVzhENEJBeGxn
In order to improve tracking quality by running sGTM on your own domain, choose a sub-domain of your main domain as the tagging-url. The sub-domain should be random (use this website to generate a random string: Random.org) Example: c3y1mavw4g.yoursite.com
Write a ticket to taglify.io Service Center with the following information: Set an A record with you registrar to the IP provided by taglify.io Service Center Hostname: c3y1mavw4g.yoursite.com Type: A TTL: 60 Data: ${IP_PROVIDED_BY_TAGLIFY}
To load the gtm-javascript code in your website. You have to make the following changes to the script on your page. Replace ${TAGGING_URL} with your tagging url. e.g. c3y1mavw4g.yoursite.com Replace ${GTM_JS_PROVIDED_BY_TAGLIFY} and ${NOSCRIPT_HTML_PROVIDED_BY_TAGLIFY} with with the values you got from taglify.io, .e.g. y16rm8ykxy.js and sldfke274jf.html Keep your existing ${WEBCONTAINER_ID}
If you want to use the preview mode in Google Tag Manager: Set the tagging domain (c3y1mavw4g.yoursite.com in our example) in the container settings.
|
Code Block |
---|
|
<!-- Google Tag Manager -->
<script>(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://${TAGGING_URL}/${GTM_JS_PROVIDED_BY_TAGLIFY}?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','${WEBCONTAINER_ID}');</script>
<!-- End Google Tag Manager -->
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://${TAGGING_URL}/${NOSCRIPT_HTML_PROVIDED_BY_TAGLIFY}?id=${WEBCONTAINER_ID}"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) --> |
...
4. Choose a custom sub-domain. Setting up a custom domain within your site's domain is highly recommended. It will enable you to set first-party cookies, making tracking more secure and resistant. Your sub-domain should be random (use this website to generate a random string: Random.org). This is your ${TAGGING_URL}
.
5. Write a ticket to taglify.io Service Center with the following information.
...