Datalayer
-
Hello,
I need to implement a datalayer on the order confirmation page of my e-commerce website (like this example https://youtu.be/fDuwmudV-oU?t=244).
I used an installation guide from Google : https://developers.google.com/tag-platform/tag-manager/web/datalayer?hl=fr.
However, how can I install the code before the google tag manager code knowing that I’m using Google site kit please ?
Here is the code :
<script> window.dataLayer = window.dataLayer || []; </script>
from
<script> window.dataLayer = window.dataLayer || []; </script> <!-- 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-XXXXXX');</script> <!-- End Google Tag Manager -->
There may be better solutions to install a datalayer, I am open to all proposals. ??
Thank you for your answer !
Good day
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Datalayer’ is closed to new replies.