- Issue created by @adanbouzoua
- Assigned to shiv_yadav
- Issue was unassigned.
- ๐บ๐ธUnited States adanbouzoua
The version 2.0.0 has not bug related to snippet placement.
The bug was introduced with the version 2.0.1 - ๐บ๐ธUnited States eojthebrave Minneapolis, MN
I bet this is what changed ... moving to using hook_page_bottom to attach the code. https://git.drupalcode.org/project/datalayer/-/commit/80a6a9e35968ca9760...
If you change that to use hook_page_top instead of hook_page_bottom does it fix the problem?
- ๐บ๐ธUnited States adanbouzoua
Update
The previous test was done with Google Tag Version: 8.x-1.6 and Datalayer 2.0.1
Changing Google Tag Version: 8.x-1.6. >> Version: 2.0.2 fix the issueConclusion: Datalayer 2.0.1 + Google Tag 2.0.2 has no issue. The module works with Google Tag version 2 but not with Google Tag version 8
---
dataLayer.push allows the snippet elsewhere than inside .
It seems that it has been implemented on Google Tag 2.0.2 but not 8.x-1.6Data Layer declaration vs dataLayer.push
By adding a dataLayer snippet above the GTM container snippet. This step is called โData Layer declarationโ.
Or by pushing data with dataLayer.push method.
https://www.analyticsmania.com/post/what-is-data-layer-in-google-tag-man... - ๐บ๐ธUnited States mihaic
I propose to update the module page documentation and also the project readme file to reflect what #6 is saying, here a patch, thanks
- ๐บ๐ธUnited States eojthebrave Minneapolis, MN
Good discovery. Thanks for digging into this more. I added a note to the project page about compatibility with Google Tag module versions.
I wonder if there's a way to add something to the composer.json file, or the .info.yml file for the module that would also declare this requirement. So that for example Composer would let you know that you have incompatible modules? I think something like that, plus a note in the README, would make the most sense.