Navigation

    Digital Liberation Forums

    • Register
    • Login
    • Search

    Individual page script location

    Plugin Support
    1
    1
    1
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      anthor last edited by anthor

      I wonder if I can locate the per page scripts of the header at the top of the page in some manner, I mean to locate any individual page script before the hole site scripts such as tag manager.

      <!-- 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://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
      })(window,document,'script','dataLayer','GTM-XXXXXXXX');</script>
      <!-- End Google Tag Manager -->
      <script>
      dataLayer = [{
      'pageCategory': 'signup',
      'visitorType': 'high-value'
      }];

      This is the individual page script header for one of the site page:

      <script>
      dataLayer = [{
      'pageCategory': 'signup',
      'visitorType': 'high-value'
      }];

      As you can see the plugin locates it below the site header and Google suggests to be located before the tag manager script as you can see in https://developers.google.com/tag-manager/devguide

      Thank you in advance

      1 Reply Last reply Reply Quote
      • First post
        Last post