Reputation: 1241
I am trying to add Google Analytics tag to all the pages in a MadCap Flare project.
The way to do this is to add the tag to de MasterPage, but MadCap Flare does not allow me to add the Google tag. If I remove the async attribute it works, but I think it is not a good idea:
If I try to add this snippet to the target configuration, I have also an error:
In both ways MadCap Flare does not allow me to save the changes.
NOTE: I am using MadCap Flare 2017 r3 (could be a bug in this version?)
Upvotes: 1
Views: 302
Reputation: 27
XHTML requires to use
async="async"
there, it should probably solve your issue.
We're using a variable for the tracking code in our masterpage so our script looks like this:
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=[%=Products.TRACKINGCODE%]">
</script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '[%=Products.TRACKINGCODE%]');
</script>
Upvotes: 1