Commit 3386ee4c authored by Shane Rice's avatar Shane Rice

moved dataLayer push below GTM container tag

parent 8e7ed5be
Pipeline #46408024 failed with stages
in 10 minutes and 6 seconds
%meta{charset: "UTF-8"}
// Creates a dataLayer above GTM tag
%script{ type: "text/javascript"}
dataLayer = [{
-if current_page.data.postType
\ 'postType': '#{current_page.data.postType}',
-if current_page.data.campaign
\ 'campaign': '#{current_page.data.campaign}',
-if current_page.data.tags
\ 'tags': #{current_page.data.tags.split(", ")}
}];
dataLayer = [];
%meta{name: "viewport", content: "width=device-width, initial-scale=1.0"}
%script document.documentElement.className = 'html--js'
......@@ -46,6 +39,16 @@
})(window,document,'script','dataLayer','GTM-NJXWQL');
-# End Google Tag Manager
-if current_page.data.postType
%script
dataLayer.push({'postType': '#{current_page.data.postType}'});
-if current_page.data.campaign
%script
dataLayer.push({'campaign': '#{current_page.data.campaign}'});
-if current_page.data.tags
%script
dataLayer.push({'tags': #{current_page.data.tags.split(", ")}});
%title
-
#{current_page.data.title ? current_page.data.title : yield_content(:title)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment