GithubHelp home page GithubHelp logo

Comments (5)

srenon avatar srenon commented on June 6, 2024 1

@alexkoepke .. thanks for the PR.

Is the dataLayer above the tags? See https://developers.google.com/tag-manager/devguide

image

from magento1-google-tag-manager.

alexkoepke avatar alexkoepke commented on June 6, 2024

@srenon I see this was resolved for the magento2 version of the extension.

I would be happy to help get this done just not sure on how to do it efficiently. Any help would be much appreciated.

from magento1-google-tag-manager.

srenon avatar srenon commented on June 6, 2024

I'll fix this shortly

from magento1-google-tag-manager.

alexkoepke avatar alexkoepke commented on June 6, 2024

@srenon should be fixed :)

from magento1-google-tag-manager.

alexkoepke avatar alexkoepke commented on June 6, 2024

@srenon,

I have updated the pull request to so the dataLayer and GTM are implemented in the following order.

<!-- Google Data Layer by MagePal-->
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({"pageType":"cms_index_index","list":"other","customer":{"isLoggedIn":false},"cart":{"hasItems":false},"ecommerce":{"currencyCode":"USD"}});

</script>
<!-- Google Data Layer by MagePal-->
<!-- Google Tag Manager by MagePal (head) -->
<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=
        '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-XXXXXX');</script>
<!-- End Google Tag Manager by MagePal (head) -->


<body class=" cms-index-index cms-home">

<!-- Google Tag Manager by MagePal (noscript)-->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager by MagePal noscript)-->

from magento1-google-tag-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.