google-analyticsEvent Tracking


Introduction

Below is the example of how to hard code the google analytics implementation in the website. To track the shopping cart actions let induce the tracking snippet. It look as below. You can track the events in google analytics open source tool

Syntax

  • ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);

Parameters

Field NameDescription
eventCategoryTypically the object that was interacted with (e.g. 'Video')
eventActionThe type of interaction (e.g. 'play')
eventLabelUseful for categorizing events (e.g. 'Fall Campaign')
eventValueA numeric value associated with the event (e.g. 42)