Skip to main content
Community Expert
August 17, 2015
Answered

Google analytics and HTML5 outputs

  • August 17, 2015
  • 3 replies
  • 3450 views


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

This topic has been closed for replies.
Correct answer Willam van Weelden

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.

3 replies

jasona66572020
Inspiring
October 29, 2015

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

Willam van Weelden
Inspiring
October 30, 2015

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

AmebrCommunity ExpertAuthor
Community Expert
September 8, 2015

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

Willam van Weelden
Inspiring
September 9, 2015

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:

AmebrCommunity ExpertAuthor
Community Expert
September 9, 2015

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.

Willam van Weelden
Willam van WeeldenCorrect answer
Inspiring
August 17, 2015

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.

AmebrCommunity ExpertAuthor
Community Expert
August 18, 2015

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.

Willam van Weelden
Inspiring
August 18, 2015

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.