Analytics
3.8K members online now
3.8K 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

Event tracking not working

[ Edited ]
Explorer ✭ ✭ ☆
# 1
Explorer ✭ ✭ ☆

Hello - for the life of me I'm unable to get conversion event tracking to fire in GA.

 

url - http://www.katyblinds.com 

 

I've added the GA script to the header of the page.  I have set up an event goal in GA exactly like I have on another site which works fine.

 

In the click submit div i have the following code...

 

<input src="/images/orange_downloadnow.png" style="width:210px;" value="Submit" onclick="ga('send', 'event', { eventCategory: 'freereportoptin', eventAction: 'submit', eventLabel: 'freereportoptin', eventValue: 10});" type="image">

 

But when that button is clicked, I get nothing in GA.  Seems pretty straightforward, but I'm totally lost.  I am receiving data in GA for traffic and everything else, just not conversions for this event.

 

On a side note, I couldn't get destination url goal to fire either.  I thought it might be because the webform redirects through the CRM before reaching the thank you page.

 

Any help would be greatly appreciated.

3 Expert replyverified_user

Re: Event tracking not working

[ Edited ]
Rising Star
# 2
Rising Star

Hey Kman, how are things?

 

The event code structure that you're using is incomplete. You're missing a required field called "hitType" to fire "event" information.

 

You should have something like this:

  

ga('send', { 'hitType': 'event', 'eventCategory': 'freereportoptin', 'eventAction': 'submit', 'eventLabel': 'freereportoptin', 'eventValue': 10 });

 

 You could use a simpler version of the event code where the field name is "implied" and do not show on the code, like this:

  

ga('send', 'event', 'freereportoptin', 'submit', 'freereportoptin', 10);


One important thing is the Value = 10. Values are just useful when you've calculated the average value of that event earlier. If this is just a random number, it will not help you at all and will just polute your data view.

 

You can refer for the full Event tracking guide, here:

https://developers.google.com/analytics/devguides/collection/analyticsjs/events

 

Hope this helps.

 

Cheers,

Leandro Martinez

 


Leandro Martinez | Basta1Click

Re: Event tracking not working

Top Contributor
# 3
Top Contributor
Hi,

Regarding the your destination goal page, when you do a search for it in Behaviour -> Site Content -> All pages can you find it? We need to make sure that users are actually visiting the page.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Event tracking not working

Top Contributor
# 4
Top Contributor
I set up a test for your event tracking code and I received the event details in my test property so your code is working. GA debugger and Tag Assistant also found no issues.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Event tracking not working

Explorer ✭ ✭ ☆
# 5
Explorer ✭ ✭ ☆
Hey Leandro - thanks a bunch for the quick reply.

Updated the code with the simplified version as you suggested and I see the event conversion in Real Time (not conversions yet), so that's freakin' killer. I'll have to check the other site now and wonder why it seems to be working there.

We don't really know the value of a click, it's a random number.

Thanks again, hope you made to TC Summit, it was fun.

Re: Event tracking not working

Explorer ✭ ✭ ☆
# 6
Explorer ✭ ✭ ☆
Hello Arnold - i do/did see the destination url in the All Pages section, but it's possible I didn't have the updated analytics.js script set up correctly. I've tried so many things, it's hard to keep track.

But thank you for your reply and confirming that the code appears to be working.

I know enough about GA to be dangerous.

Re: Event tracking not working

Explorer ✭ ✭ ☆
# 7
Explorer ✭ ✭ ☆
I guess I spoke to fast, I see the Event in Real-Time, but it never turned into a conversion.

I think the issue has to do with re-using an old goal that was inactive. Since you cannot delete goals in GA, I re-used an old goal that was no longer useful; time on site or #pages or something, I don't know.

Today, I created a "brand new" goal with the exact same settings and turned off the old one. The new event goals started tracking events AND conversions immediately in Real Time (but haven't shown up in Conversions yet).

So, does that make sense? Why would re-using an inactive goal create this issue and what steps should I use to prevent this from happening in the future? About 16 of the 20 goals were set up at one time or another and are all now inactive.

Re: Event tracking not working

Rising Star
# 8
Rising Star
Hey Kman, using an old goal shouldn't be the problem if you've configured everything correctly. If the event was firing, probably some mistype on the goal? If the event is working, it's definitely something related to the goal set up. A lot of times I see a "space", blank character at the end of goals, which will make them break. Stuff like that should be considered.

Also, event goals must be EXACT as the goal, that means upper and lowercase letters. If you use "freereportoptin" on the event and "Freereportoptin" on the goal, your goal won't work. If you can double check the old goal to see if there's anything wrong...

Leandro Martinez | Basta1Click

Re: Event tracking not working

[ Edited ]
Explorer ✭ ✭ ☆
# 9
Explorer ✭ ✭ ☆

Hi Leandro - Thanks for the follow up.

I agree that using an old goal shouldn't be an issue. I checked the two event goal set ups, they were identical, no extra spaces (but a great suggestion), no difference in caps, etc.

I created a new event goal re-using a different inactive goal and it does fire just fine. Then I went back and tested the original event goal, it is now working too.

The only setting I think I changed was to enable Enhanced Link Attribution. Could that be the issue??

Re: Event tracking not working

Rising Star
# 10
Rising Star
Hey Keenan,

I'm personally not aware of any conflicts that may occur between Enhanced Links and Events, but is definitely something worth some testing now.

It's very strange that everything is working now, but Real-time tool is known for having some delay at times, even crashing. It's a good thing to follow, but a lot of people don't truly rely on this. Maybe you were trying to test when real-time was facing some instability...hard to tell with everything working. Is it possible that you made some changes but didn't apply, even thinking you did?

Leandro Martinez | Basta1Click