Highlighted

Google analytics and HTML5 outputs

Adobe Community Professional ,
Aug 16, 2015

Copy link to clipboard

Copied


Hi all,

Does anyone have any experience with adding Google Analytics (Universal Analytics) to either Responsive or Multiscreen HTML5?

I'm looking for hints, tips or RH HTML5 specific quirks that anyone has come across.

Thanks for any insight you can provide,

Amber

You can add the tracking code to the footer of the master page, just like WebHelp. It works for Multiscreen, but I haven't implemented it for the REsponsive (11.0.3 and later, it works for 11.0.2 and earlier). But I see no reason why it won't work.

Topics

HTML5 layout

Views

1.8K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Google analytics and HTML5 outputs

Adobe Community Professional ,
Aug 16, 2015

Copy link to clipboard

Copied


Hi all,

Does anyone have any experience with adding Google Analytics (Universal Analytics) to either Responsive or Multiscreen HTML5?

I'm looking for hints, tips or RH HTML5 specific quirks that anyone has come across.

Thanks for any insight you can provide,

Amber

You can add the tracking code to the footer of the master page, just like WebHelp. It works for Multiscreen, but I haven't implemented it for the REsponsive (11.0.3 and later, it works for 11.0.2 and earlier). But I see no reason why it won't work.

Topics

HTML5 layout

Views

1.8K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
LEGEND ,
Aug 17, 2015

Copy link to clipboard

Copied

You can add the tracking code to the footer of the master page, just like WebHelp. It works for Multiscreen, but I haven't implemented it for the REsponsive (11.0.3 and later, it works for 11.0.2 and earlier). But I see no reason why it won't work.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Aug 17, 2015

Copy link to clipboard

Copied

Thanks Willam.

So it looks like the code can go anywhere in the page, contrary to Google's instructions to add it immediately before the closing head tag?

I'd also be curious to see if anyone can confirm the code works accurately with RH Responsive, as I've seen some articles warning of problems with iframes, and I believe Responsive from 11.0.3 uses them. Although this is more about academic curiosity for me, as I'm using Multiscreen for the moment.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
LEGEND ,
Aug 18, 2015

Copy link to clipboard

Copied

You can put the tracking code anywhere. A lot of companies tell you to place there code at a specific location. But most of the time, it doesn't really matter. The header/footer will work just fine.

I've never had problems with iFrame before. Google Analytics works fine for WebHelp and that uses frames as well.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Aug 18, 2015

Copy link to clipboard

Copied

Thanks Willam.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Sep 07, 2015

Copy link to clipboard

Copied

I've successfully put Google Analytics code in my Multiscreen HTML5 master page and we are able to see data being collected.

One thing I think might be a problem is that the GA code doesn't appear on the search page. We can get some search data if users click on a search results hyperlink; however I'd really like to capture searches where no results are returned, or if the user doesn't click on a hyperlink. I think the only way to do this is to include the GA code in the screen layout.

Does anyone know if there are any downsides to putting the GA code in the screen layout pages (topic and search results) instead of in the master page for Multiscreen HTML5?

Are the considerations for Responsive HTML5 different?

Thanks in advance,

Amber

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
LEGEND ,
Sep 09, 2015

Copy link to clipboard

Copied

If you want the search queries to be reported to google, you have to hook RH up as a custom search engine in Google. I have done this for clients in the past with the Responsive output and it works like a charm.

You have to set the URL parameter 'rhsearch' as the parameter for Google Analytics.

How to set this up is described on:

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Sep 09, 2015

Copy link to clipboard

Copied

Thanks Willam, I believe that's been done (although I can't confirm the exact setup right now I do know rhsearch was set up somewhere in GA, and site search tracking was turned on - lack of search tracking was discovered by my SME a few days after we added the code).

I can see search terms as long as a result link is clicked. However if the user doesn't click a link, then the search term does not show up in analytics.

For example, say I search on 'gizmo'. The search returns 10 results. But I *don't* click on a link. Instead I type a new term, 'widget', which returns 5 results. I click on one of the links. After some time 'widget' will show in the analytics, but 'gizmo' never does.

I believe this is because the google analytics code does not get added to the search results page by using the master page method. As far as I can tell, the only way to add it is to modify the screen layout, but I'm unsure what side effects this might have.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
LEGEND ,
Sep 09, 2015

Copy link to clipboard

Copied

Which layout are you using? If you open the file Topic.slp or SearchResults.slp in Notepad (Don't open in RoboHelp or it will break the layout!) you can add the tracking code as well.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Sep 09, 2015

Copy link to clipboard

Copied

We have a custom Multiscreen HTML5 layout.

Do you think it would be best to remove the code from the master page and just add it via the topic.slp and search.slp files?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
LEGEND ,
Sep 09, 2015

Copy link to clipboard

Copied

Yes. If you add it to the topic.slp and the search page, it will work better than using the master page.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Sep 09, 2015

Copy link to clipboard

Copied

Many thanks. I'll give it a go tomorrow.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Jan 30, 2019

Copy link to clipboard

Copied

Hi Willam,

just a long shot in asking for help here. i followed the links you provided to try and implement site search tracking. i was able to create a custom search engine and link it with google analytics.

CSE_GA.png

i guess i didn't need to blur out the query parameter: rhsearch

I've also set up site tracking from the GA side:

GA_siteSearch.png

yet no results, even a day later.

the portion of the instructions from this link: Configure Google Analytics Site Search - Custom Search Help

which i am unable to confirm is where in the image it says to Paste your CSE code snippet. I am unable to find that? any help would be appreciated.

Best,

John

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Jan 30, 2019

Copy link to clipboard

Copied

If you're using RH2019 Classic or earlier, I'd recommend pasting into the Topic.slp and Search.slp/SearchResults.slp (if it exists) files. You could also paste into your master page, but as described above, there are scenarios where you won't get results.

If you're using RH2019 New, I couldn't even begin to guess

(You might also need to change the async bit in the code. I think to async="async" but I can't remember - search the forums to see if anything turns up. I haven't moved to gtag yet.)

Also note that I've only used it in Multiscreen HTML5 so unsure of what differences might exist if you're using Responsive HTML5

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Jan 31, 2019

Copy link to clipboard

Copied

thanks for the response. i am using robo 2015 with the responsive html5 layout. i checked the layout folder in the output pod and could only find the topic.slp file.

i did paste it in there as well so i have the GA code in both topic.slp and footer of the master page and this is working. just the site search hasn't been yielding any results.

i will check the async bit of the code to see if editing it to that will work.

i followed willam's links as well and set up the CSE but no luck yet.

will keep searching. thanks again

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Feb 04, 2019

Copy link to clipboard

Copied

this is incorrect and doesn't work. the only instance the site searches were reported to GA was when the google search bar/engine itself was inserted into the RH site and used.

any queries made from the RH search bar didn't connect with GA even after connecting it to google's CS.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Feb 04, 2019

Copy link to clipboard

Copied

Sorry I can't be any more help. All I can say is it works for me in RH11 Multiscreen HTML5.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Feb 12, 2019

Copy link to clipboard

Copied

A couple of thoughts.

Have you blocked third-party cookies in your browser?  Try enabling them and see it that works.

Are you running an ad-blocking extension in your browser? Try disabling it for the site and see if the search goes through.

Also, when testing, wait 10 minutes after performing a search. It can take some time to show up.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Feb 13, 2019

Copy link to clipboard

Copied

Hi Amebr,

Thanks for the help on this one. Here is what I have learned:

Robohelp Responsive HTML5 output hashes URL info. So for example you might see: */index.htm#firsttopic.htm

everything or most things after the # is "invisible" to google analytics. my cynical self wants to say that this is adobe's way of making it harder to work with third party analytics.

there are ways online of making a fragmented URL visible to google analytics. and this is actually what will do the trick. but from the work i have done so far, it is only the first half of what needs to be done.

as of now, google analytics is able to better track the URLs, # and all.

Now the second half related to Site Search is the tricky part. See GA needs a query parameter as we know and it identifies the query parameter as the character following the ? in the URL. so for example in the ideal world, if adobe programmed robohelp to show in the URL: ?rhsearch= then this would make it easy for google analytics to pull all terms following that as site searches.

but that is not the case. however, since now google analytics can see the entire actual URL, then it is a matter of figuring out how to append the URL with our own ? parameter to help it easily track site searches.

technically, with the first half completed, you could simply go to google analytics site contents report under behavior and see all URLs that have rhsearch in it. this would be the search terms.

i am not overly familiar with creating custom reports but i assume a report can be made to pull all URLs containing that for ease of analysis.

anyway, thats what i have for now. if i figure out the second half i will come back.

i am also hoping to be able to figure out site searches that yield 0 results. but we shall see.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Oct 29, 2015

Copy link to clipboard

Copied

Where is the topics.slp file?  I can't seem to find it on searching the project files from Explorer...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
LEGEND ,
Oct 30, 2015

Copy link to clipboard

Copied

In your RH project: !ScreenLayout!/<screen layout name>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...