Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Goal: A taglify.io server-side GTM container linked to your Google Tag Manager is configured and running.

Info

Summary of steps

  1. Note down your existing GTM Web Container Id

    1. Example: GTM-WHJ8FZC

  2. Create a new Google sGTM container on tagmanager.google.com

and check
  1. . Check the option “Manually provision tagging server”.

  2. Copy the Container Config String

    1. Example: aWQ9R1ABLVdISjlGWkMmZW52PTEmYXV0aD1VUzlrbVhlUWxtcElyVzhENEJBeGxn

  • Copy the Web Container Id (Attention: This is not the ID of the server-side container)

    1. Example: GTM-WHJ8FZC

    1. 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)

      1. Example: c3y1mavw4g.yoursite.com

    2. Write a ticket to taglify.io Service Center with the following information:

      • Web Container Id

      • Container Config String

  • Web Container Id

      • Your Sub-Domain (c3y1mavw4g.yoursite.com in our example)

    1. Set an A record with you registrar to the IP provided by taglify.io Service Center

      1. Hostname: c3y1mavw4g.yoursite.com

      2. Type: A

      3. TTL: 60

      4. Data: ${IP_PROVIDED_BY_TAGLIFY}

    2. To load the gtm-javascript code

    via your sgtm-container you
    1. in your website. You have to make the following changes to the script on your page.

      1. Replace ${TAGGING_URL} with your tagging url. e.g. c3y1mavw4g.yoursite.com

      2. Replace ${

    CONTAINER
      1. GTM_JS

    _ID
      1. _PROVIDED_BY_TAGLIFY} and ${NOSCRIPT_HTML_PROVIDED_BY_TAGLIFY} with with the

    container-js-id
      1. values you got from taglify.io, .e.g. y16rm8ykxy.js

    Replace
      1. and sldfke274jf.html

      2. Keep your existing ${WEBCONTAINER_ID}

    with your Web Container Id.
    1. If you want to use the preview mode in Google Tag Manager:

      1. Set the tagging domain (c3y1mavw4g.yoursite.com in our example) in the container settings.

    Code Block
    languagejs
    <!-- 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}/${CONTAINERGTM_JS_IDPROVIDED_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) -->

    How to setup a sGTM tagging container with taglify.io

    1. Make a note of your Web Container Id. You can find this at https://tagmanager.google.com/#/home. It has the form GTM-XXXXXXX.

    2. Go to tagmanager.google.com and log in.

    ...

    3. Note the long string in the field Your Container Config is:. Also make a note of your Web Container Id. You can find this at https://tagmanager.google.com/#/home.

    4. Write a ticket to taglify.io Service Center with the following information.

    • Container Id

    • Container Config String

    • Your custom sub-domain, so that tagging runs in a first-party context

    4.1 A custom sub-domain step is strongly suggested, but it is not needed. When the container is up and running, we’ll provide you with the default Tagging Server URL provided by taglify.io.

    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. Send your FirstParty Domain that you want to use for the setup with the ticket. The 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.

    • Container Config String (aW.....)

    • Your existing Web Container Id (GTM-XXXXXXX)

    • Your custom sub-domain

    6. We will setup your containers and give you the following values, which you need for later steps:

    • ${IP_PROVIDED_BY_TAGLIFY}: A dedicated IP for your server-side containers

    • ${GTM_JS_PROVIDED_BY_TAGLIFY}: An alternative file-name for the gtm.js file to improve the chance to bypass ad-blockers

    • ${NOSCRIPT_HTMLPROVIDED_BY_TAGLIFY}: An alternative file-name for the ns.html file to improve the chance to bypass ad-blockers

    7. Setup DNS A-Records for your sub-domain. After that, create an A record that corresponds to the IP address given by taglify Service Center ${IP_PROVIDED_BY_TAGLIFY}. The DNS settings should look like the one in the screenshot.:

    ...

    It may take up to 72 hours to verify the domain, however in most situations it will be done in 3-4 hours.

    Once the domain has been verified by us, the tagging server is ready to go, and you can move on to the sGTM configuration.

    57. Google strongly advises that you update your site's WEB GTM code. It's ideal if you use your own domain instead of www.googletagmanager.com. Make certain you didn't delete /gtm.js.

    Updating your web GTM code allows gtm.js to be loaded from your domain:

    • Replace ${TAGGING_URL} with your tagging url. e.g. c3y1mavw4g.yoursite.com

    • Replace ${CONTAINERGTM_JS_ID_PROVIDED_BY_TAGLIFY} and ${NOSCRIPT_HTMLPROVIDED_BY_TAGLIFY} with the container-js-id values you got from taglify.io . e.g. y16rm8ykxy.js and sldfke274jf.html

    • Replace ${WEBCONTAINER_ID} with your existing Web Container Id.

    Code Block
    languagejs
    <!-- 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}/${CONTAINERGTM_JS_PROVIDED_BY_IDTAGLIFY}?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_HTMLPROVIDED_BY_TAGLIFY}?id=${WEBCONTAINER_ID}"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
    

    A fully working example might look like this:

    Code Block
    languagejs
    <!-- 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://c3y1mavw4g.yoursite.com/y16rm8ykxy.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-AAA9FZCWHJ8FZC');</script>
    <!-- End Google Tag Manager -->
    Next, add this code immediately after the opening <body> element on every page of your website. Replace GTM-XXXXXX with your container ID:
    
    
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://c3y1mavw4g.yoursite.com/sldfke274jf.html?id=GTM-WHJ8FZC"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
    

    67. In order to use the preview mode in your Google Tag Manager account, you have to configure it in the Container Settings. Open the admin panel of your container. Click on Container Settings. Click on Add URL under Server container Urls. Enter the tagging url. If you are not using a first-party setup, enter the tagging url you received from taglify.io . ${TAGGING_URL}.

    ...

    78. Congratulation. The sGTM container has been set up. You may now start configuring server-side tagging in sGTM.

    ...