Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Put the script in your layout view and populate the values from your model or logic, e.g:
<script> window.dataLayer = window.dataLayer||[]; window.dataLayer.push({ 'content.pagetype': '@Model.PageTypeName', ....... }); </script>
Hi!
On the same topic...
I would like to push to the datalayer for Google Tag Manager when a visitor visits a specific page, but the issue is the push needs to come before the GTM container.
Since it is only for a specific type of page I can not place it in the head of global Layout-file.
Now I am wondering, how do I manage to get the push before the GTM container loads on the page?
Thanks in advance!
Regards,
Sophie Hillebrant
Hi,
I want to create data layer for Google Tag Manager which will be a script with dynamic data in body section of all pages.
Can anyone please explain how can we implement it(through SitePageData etc) with an example.
Thanks in advance.
Best Regards,
Sanket Mahimkar