I am trying to set up click tracking on a link on an acquisition page. I have added the following code just below my google analytics JS snippet:
jQuery(".submit-button").click(function(){
ga('send', {
hitType: 'event',
eventCategory: 'register',
eventAction: 'click',
eventLabel: 'registrations'
});
});
First question is do I need to add a value to the object above or will the default value be 1?
Secondly to see the click reporting in google anayltics I have set up a Goal in the admin panel that has the following settings:
Goal setup: custom
Goal Description: Event
Goal Details: Category - Equals to - register, Action - Equals to - click, Label - Equals to - registrations, Value - Equals to - (this field is set to blank)
Second question: is this the correct way to intercept my click event in the GA interface?
Sorry if this is an obvious question but online documentation isn't 100% clear with click events
Yes, the code is correct (provided the ga code has been loaded before and a tracker with the default name has been created). Goal setup looks okay, too.
No, value will not default to one, it will default to zero - which is probably want you want anyway, because the event value is a metric (number) that is used to monetize goals that are not transactions. If you set a value it would for example be used in the Adwords reports when calculating the ROAS (return on advertising spend). Typically you would put a number there that reflects how much value you assign to a goal conversion, and that value will mpst of the time not be "1" (unless 1 Dollar/Euro/etc is your expected revenue from a goal conversion). If you do not assign a monetary value to the goal conversion just skip it, it's optional (so your setup is fine).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.