Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Analytics: Event Tracking Parameters

I am using ga for my website.

but when i call track event like this

_gaq.push(['_trackEvent', 'abc', 'def','pqr','xyz']);

it does not work but when i call function by removing last parameter i.e 'xyz' it works properly it looks like this

_gaq.push(['_trackEvent', 'abc', 'def','pqr']);

where _gaq is an array which contains my ga account no. and domain info.

my concern is I want to pass four parameter with '_trackEvent' parameter like this..

_gaq.push(['_trackEvent', category, action,label,value]);

but this is not working.

Plz help

like image 707
Harshal_m_joshi Avatar asked Dec 01 '22 01:12

Harshal_m_joshi


1 Answers

The Google Analytics API Event Tracking Guide states that the trackEvent method accepts 5 parameters:

  • category (required)
  • action (required)
  • label (optional)
  • value (optional)
  • non-interactive boolean (optional)

The second-to-last parameter (value) has to be an integer, and so does not work when a string is passed.

like image 128
Matt Austin Avatar answered Dec 04 '22 16:12

Matt Austin