WordPress.org

Forums

DuracellTomi's Google Tag Manager for WordPress
[resolved] Uncaught SyntaxError: Unexpected token } (7 posts)

  1. Watch Teller
    Member
    Posted 10 months ago #

    Am I missing anything here? Need Help

    }</script><div class="right cart-tab no-animation light hidden"> <span class="amount">$0.00</span><span class="contents">0 items</span> </div> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-xxxxxx" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': Uncaught SyntaxError: Unexpected token }
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],

    Thanks in advance

    https://wordpress.org/plugins/duracelltomi-google-tag-manager/

  2. duracelltomi
    Member
    Plugin Author

    Posted 10 months ago #

    Could you post the URL of your site?

  3. Watch Teller
    Member
    Posted 10 months ago #

    Hi,

    bigbestbuy[.]asia

    Thanks

  4. duracelltomi
    Member
    Plugin Author

    Posted 10 months ago #

    Hi,

    You placed that one line of PHP code to the wrong place.
    Instead of the <head> section, move it just _after_ the opening <body> tag

    Cheers,
    Thomas

  5. Watch Teller
    Member
    Posted 10 months ago #

    The problem have gone. Thanks.

    Can I move you 2 js at head section to after body section or footer for page load speed optimization?

    1. duracelltomi
      Member
      Plugin Author

      Posted 10 months ago #

      The datalayer needs to be setup in the head section, the GTM container code has to be created after the <body> tag thus I do not advise to move any code to somewhere else

    2. Watch Teller
      Member
      Posted 10 months ago #

      Hi, noted and thanks. With your plugin can ignore to have WooCommerce Google Analyticd plugin, look like your plugin have same features.

      I am newbie, still further digging to leverage yr plugin, except yr plugin standard features, any other tag need my peraonal added in google tag manager for blog post and WooCommerce product post.

      Any useful tutorials guide artical or link for me further digging study.

      Thanks.

    Reply

    You must log in to post.

    About this Plugin

    About this Topic

    Tags

    No tags yet.