Analytics
2.1K members online now
2.1K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

HTML5 banner click tracking

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi, I have a problem with the tracking of some ads on my page. All of the banners are created in Adobe Animate CC and are a HTML5 containing a simple animation and a button with a link that leads to my customers site. The ads are placed by an iframe on the page via a ad-system (AdRotate) and is not a part of Google Adwords. AdRotate tracks impressions by Google Analystics, but not clicks. I talked to them and they told me that this is because the link is within the banner itself, and not in the code placing the banner. This works if the banner is a gif or a jpeg, since the link will then be in the code placing the banner.  I really hope i don't have to go back to only using .gifs as banners on our page, so here comes the question: How can i track the clicks in an HTML5-banner, using Google Analytics?

I have red quite a bit online, and found the code

_gaq.push([‘_trackEvent’, ‘button’, ‘clicked’]);

but where do I put the code, and do I need to paste the whole tracking-code for GA in my banner-code as well? help-help-help!

 
 
1 Expert replyverified_user

Re: HTML5 banner click tracking

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭
please help me on my campaign

Re: HTML5 banner click tracking

Top Contributor
# 3
Top Contributor

Hi, @Ingrid Helen S,

 

Can you clarify a few things? So you are trying to track clicks to a banner, which is using the code 

 

_gaq.push([‘_trackEvent’, ‘button’, ‘clicked’]);

That code is relevant to the older Classic GA. Are you using classic GA or the newer Universal Analytics (in which case the code would be different).

 

Is the banner that you want to track within an iframe? If it is, then unless you have your tracking code in the iframe, then you can't track clicks.

 

Perhaps it would be also easier if you show us your page and where these banners are that you are trying to track.

 

@Sampathi L, can you please be more specific with what you are asking?

Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: HTML5 banner click tracking

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
Thank you for responding Smiley Happy
Yes, I am trying to track clicks to a banner, and I am using Universal Analytics.
The banner is placed by an iframe - since its a html5 document with JS. How can i put the tracking-code in the iframe??
Our page is http://inarvik.org/ And the banners I am trying to track the clicks on are the ones that is animated, the top banner and sidebar-banner.

Re: HTML5 banner click tracking

Top Contributor
# 5
Top Contributor
Hi Ingrid,

So I noticed a couple things.

1. You are tracking your pageviews twice, so when I land on the page, it looks like two pageviews are sent. it also looks like you are including the GA snippet on your pages two times.
2. Since the iframes are in the same domain as your page (ie. http://inarvik.org/), you should be able to add tracking code to those links. You'll need to use the UA code though, so:

ga('send', 'event', 'banner', 'click');

rather than the older code you had.

Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: HTML5 banner click tracking

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
Thats weird. I have only pasted my code in my theme once, how can i fix this? My theme says: "Paste here the Universal Analytics tracking code for this property. The code will be added to the body tag on all the sites pages" How can I find the other place its pasted??

This UA code - where do I put it - inside my HTML5banner-code or in the code placing the banner.

Thank you so much for all your help!