Copy link to clipboard
Copied
Is there a way to add the Google Analytics tags to Master Pages so that they all get updated with the tag?
Thanks in advance.
Copy link to clipboard
Copied
If you edit a master page, it only updates the header and footer of existing topics. Could you not use a multi file find and replace tool? Work on a copy of the project to try it.
See www.grainge.org for RoboHelp and Authoring tips
Copy link to clipboard
Copied
Hi there
It might be possible to achieve using Master Pages. But I'm unsure about what is expected. Can you supply us with the code you wish to add and tell us where the code should end up in the topic?
Cheers... Rick
Helpful and Handy Links RoboHelp Wish Form/Bug Reporting Form Begin learning RoboHelp HTML 7 or 8 within the day - $24.95! |
Copy link to clipboard
Copied
Yes using master pages is an easy way to go for Google analytics.
I apply the master page as part of the publish and put any other headers and footers I want in the same .htt file.
Put the google code in the HTML body in rh-region footer.
The relevant part is this: (extract from xxx.htt):
..
<body>
....
<?rh-region_start type="footer" style="width: 100%; position: relative;" ?>
<script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script>
<script type="text/javascript">try {
var pageTracker = _gat._getTracker("UA-1234567-1");
pageTracker._trackPageview();
} catch(err) {}</script>
<?rh-region_end type="footer" ?>
...
</body>
regards,
Peter