I have few questions regarding event tracking:
1. Do I need to add the tracking code UA-xxxxxxxx-x to all the webpages or can I just add the tracking code to the main webpage and event code to other pages?
ga('send', 'event', 'eventCategory','eventAction' , 'eventLabel');
So, one of my webpage contains only event code and not the tracking code, will it work?
2. Can we add any "value type" to event category, action and label or do we have some default value types.
Tracking events[ Edited ]
May 2017 - last edited May 2017
2. No, Value Type for Event Category, Action and Label is "String" (text) by default and this cannot be changed. If you need to send a value together with the event you can assign it as event Value. Example: ga('send', 'event', 'eventCategory','eventAction' , 'eventLabel', 5);
If you want to read more about google analytics events, please refer to following link(official Google Analytics developer guide): https://developers.google.com/analytics/devguides/collection/analyticsjs/events
I hope my answer helps you.