AdWords
4.2K members online now
4.2K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

Event Tracking on a pop up button

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have used a pop up button to display features on a specific page. I am using event tracking gaq_push code to track the clicks on this button, however am not getting any hits in the event tracking section in the Analytics profile.

 

The code used is as below

 

<a id="pop" href="#">

<img class="plus-mark interior-box" onclick="_gaq.push(['_trackEvent', 'What's New- Interiors', 'Click', 'Black and plum Interiors']);">
</a>
 
What could be the issue because of which the clicks are not generating hits?
2 Expert replyverified_user

Re: Event Tracking on a pop up button

Top Contributor
# 2
Top Contributor

Hello niishanth and welcome,

 

Did you follow the correct procedure to track event tracking? 

 

I would encourage you to cross check the method mentioned in this developers guide section of Google Analytics:

 

https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide#SettingUpEventTr...

 

Further for more details you might consider posting this question over Google Analytics forum. This is the link to that :

 

http://productforums.google.com/forum/#!forum/analytics

 

Pankaj

Re: Event Tracking on a pop up button

Participant ✭ ☆ ☆
# 3
Participant ✭ ☆ ☆
I am sorry but i think you have done it wrong. Instead of putting the onclick code on the image class, can you try it instead the href?

Also i appreciate to change What instead of What's.

Re: Event Tracking on a pop up button

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

hi Pankaj,

 

I have tried the code as shared in the link. However that did not work, hence modified the code to see if that would help resolve the issue. However still no success.

 

We are using a pop up to display a small feature in a layer on the same page. The event tracking is intended to track the number of hits the pop ups is registering.

 

Any advice on what could be wrong?

Re: Event Tracking on a pop up button

Top Contributor
# 5
Top Contributor

Hi niishanth,

 

Images do not have an onclick event by default. The easiest way to fix this is to move the onclick event code to the link:

 

Example:

 

<a id="pop" href="#"  onclick="_gaq.push(['_trackEvent', 'What's New- Interiors', 'Click', 'Black and plum Interiors']);">

<img class="plus-mark interior-box" alt="Black and plum Interiors">
</a>
 
I'm not even going to go into the hard way to get it done.
 
Best of Luck!
 
Pete
 
 
petebardo -- Deadhead doing AdWords