Reputation: 111
We offer an instant access which auto logs users into a demo account (of our CRM system).
I'm using event & conversion tracking in Google analytics to trigger when:
Category equal to: Instant-access
Action Equal to: Instant-access-sign-up
Label equal to: Instant-access-sign-up
Value equal to: 35
The original link looks like:
https://secure.workbooks.com/login?demo=1
Link auto signs users into a demo account.
So the link I've created (event tracking added onto link to track) is:
https://secure.workbooks.com/login?demo=1?onClick="ga('send', 'event', { eventCategory: 'Instant-access', eventAction: 'Instant-access-sign-up', eventLabel: 'Instant-access-sign-up', eventValue: 35
However this doesn't seem to be working. Any idea what it is that's not working?
I've provided my links as code, since they provide no value as links as we're studying the link parameters.
Upvotes: 0
Views: 340
Reputation: 13495
onclick is an attribute on an element, not something you can add to a URL.
If you want to track the event on the page you are on when you click the link, you do:
<a href="/demo/" onclick="ga('send', 'event', { eventCategory: 'Instant-access', eventAction: 'Instant-access-sign-up', eventLabel: 'Instant-access-sign-up', eventValue: 35});">my demo</a>
If the tracking you are targeting is on the demo page itself, the pageview should be fine for a goal.
Upvotes: 1