erdomester
erdomester

Reputation: 11829

Google Analytics download event goals not tracked

I set up some Event goals that are not tracked.

For example I have some documents to download on my page. I have been clicking on them for a few days, yet all goals show 0 conversions.

Category: Equals to: Docs
Action: Equals to: Download
Label: Equals to: Best practices

Here is the onClick event in the code:

<a href="/Docs/Best-Practices.pdf" target="_blank" class="dl" onClick="_gaq.push(['_trackEvent', 'Docs', 'Download', 'Best practices',, null]);">Best practices</a>

or

<a href="/Docs/Best-Practices.pdf" target="_blank" class="dl" onClick="_gaq.push(['_trackEvent', 'Docs', 'Download', 'Best practices']);">Best practices</a>

(neither of them works)

enter image description here

Am I missing something here?

Upvotes: 2

Views: 1833

Answers (2)

MrSponge
MrSponge

Reputation: 868

Perhaps you are using the newer Universal Analytics? Then the syntax is different then the Classic Analytics.

Classic Analytics uses gaq.push:

<a href="/Docs/Best-Practices.pdf" target="_blank" class="dl" onClick="_gaq.push(['_trackEvent', 'Docs', 'Download', 'Best practices']);">Best practices</a>

Universal Analytics uses a different one, as detailed here:

You can also send events using the following convenience commands. In each command, the optional parameters have been removed.

ga('send', 'event', 'category', 'action');
ga('send', 'event', 'category', 'action', 'label');
ga('send', 'event', 'category', 'action', 'label', value);  // value is a number.

So your example would look something like this:

<a href="/Docs/Best-Practices.pdf" target="_blank" class="dl" onClick="ga('send', 'event', 'Docs', 'Download', 'Best practices');">Best practices</a>

Also, to find out if the tracking code you have installed, search for ga.js for Classic Analytics or analytics.js for Universal Analytics.

Upvotes: 2

Mark Hansen
Mark Hansen

Reputation: 1062

Since you are creating a goal based on the event, it could be a problem with how the event is set up, or how the goal is defined. Looking at your code and set-up, I don't see any obvious problem.

To debug, check first to see if you are getting events by looking in Behavior >> Events >> Overview. If you are getting events, then it should look something like this.

events overview

If you are getting events, then look at Conversions >> Goals >> Overview and see if you are getting any goal conversions.

Sometimes it takes a while for event based goals to show up in GA - at least that has been my experience. I've seen it take as long as 48 hours.

Upvotes: 1

Related Questions