fooman / googleanalyticsplus

Magento Extension to add extra features to the default GoogleAnalytics module.
http://store.fooman.co.nz/extensions/magento-extension-googleanalyticsplus.html
100 stars 53 forks source link

New Google Tag Manager Implementation Method #105

Closed Morgy93 closed 6 years ago

Morgy93 commented 7 years ago

Google Tag Manager changed its implementation method: https://developers.google.com/tag-manager/quickstart

You now need to place the gtm container script as close to the opening tag as possible. And the

shaan-19 commented 7 years ago

As mentioned in https://github.com/fooman/googleanalyticsplus/issues/65

Please move the script code to the top of the head tag and the noscript snippet to the top of the body tag.

shaan-19 commented 7 years ago

@fooman any update for this issue?

fooman commented 7 years ago

@shaan-19 Updates to our Magento 1 extensions are currently not high on our list of our priorities. You can try shifting these lines

        <block type="googleanalyticsplus/tagManager" name="googleanalyticsplus_tagmanager"
               as="googleanalyticsplus_tagmanager"/>

from here https://github.com/fooman/googleanalyticsplus/blob/master/app/design/frontend/base/default/layout/googleanalyticsplus.xml#L18 to here https://github.com/fooman/googleanalyticsplus/blob/master/app/design/frontend/base/default/layout/googleanalyticsplus.xml#L11

fooman commented 6 years ago

I have just merged a pull request #115 which moves the JS into the html head. Please note that you would need to remove the previously copied snippet and just enter your GTM id.