Google Analytics Code - Help? From RoboHelp

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
ElaineB
Propeller Head
Posts: 21
Joined: Fri May 27, 2016 9:29 am

Google Analytics Code - Help? From RoboHelp

Post by ElaineB »

Hi all,

I have browsed the Google Analytics topics on these forums and thus far have not found the answer to what we need.

We are transitioning from RH to Flare, and in the Flare Master page for WebHelp (we do not use HTML5 output) we need to insert a google analytics script. The only script we have is used in RH and has a ton of RH code in it. I have no idea how to get this to work in Flare, and when I try "insert script > javascript" it doesn't work either.

Thoughts? Code is below.
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="topic-comment" content="Generic page to apply at run time with google tracking analytics code" />
<meta name="generator" content="Adobe RoboHelp 11" />
<title>WebHelp</title>
<link rel="StyleSheet" href="default.css" type="text/css" />
</head>

<body>
<?rh-script_start ?><script src="ehlpdhtm.js" type="text/javascript" language="JavaScript1.2"></script><?rh-script_end ?>
<?rh-region_start type="body" ?>
<p> </p>
<?rh-region_end type="body" ?>
<?rh-region_start type="footer" style="width: 100%; position: relative;" ?>
<p>  </p>
<p>  </p>

<script type="text/javascript">(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-73196602-1', 'auto');
ga('send', 'pageview');</script>
<?rh-region_end type="footer" ?>
<?rh-script_start ?><script type="text/javascript" language="JavaScript1.2">//<![CDATA[
if( typeof( FilePopupInit ) != 'function' ) FilePopupInit = new Function();
FilePopupInit('a2');
//]]></script><?rh-script_end ?>
</body>
</html>
Psider
Propellus Maximus
Posts: 902
Joined: Wed Jul 06, 2011 1:32 am

Re: Google Analytics Code - Help? From RoboHelp

Post by Psider »

Just the highlighted bit is the GA code you need. It should make it easier to add to Flare, although I don't have Flare at the moment so can't give specifics of how and where.

<body>
<?rh-script_start ?><script src="ehlpdhtm.js" type="text/javascript" language="JavaScript1.2"></script><?rh-script_end ?>
<?rh-region_start type="body" ?>
<p> </p>
<?rh-region_end type="body" ?>
<?rh-region_start type="footer" style="width: 100%; position: relative;" ?>
<p>  </p>
<p>  </p>

<script type="text/javascript">(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-73196602-1', 'auto');
ga('send', 'pageview');</script>

<?rh-region_end type="footer" ?>
<?rh-script_start ?><script type="text/javascript" language="JavaScript1.2">//<![CDATA[
if( typeof( FilePopupInit ) != 'function' ) FilePopupInit = new Function();
FilePopupInit('a2');
//]]></script><?rh-script_end ?>
</body>
</html>
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Google Analytics Code - Help? From RoboHelp

Post by NorthEast »

ElaineB wrote:I have no idea how to get this to work in Flare, and when I try "insert script > javascript" it doesn't work either.
Open your master page, and use insert > script to add the script.

Copy and past the Google code as provided by GA; i.e.:

Code: Select all

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-73196602-1', 'auto');
ga('send', 'pageview');
ElaineB
Propeller Head
Posts: 21
Joined: Fri May 27, 2016 9:29 am

Re: Google Analytics Code - Help? From RoboHelp

Post by ElaineB »

Thanks so much everyone! That worked!
Post Reply