_trackEvent() from Google Analytics not working?

前端 未结 4 1371
不思量自难忘°
不思量自难忘° 2020-12-31 01:45

I have Google Analytics setup on my site, and it is definitely recording page views. But I have added some code to call pageTracker._trackEvent(category, action, labe

4条回答
  •  心在旅途
    2020-12-31 01:57

    The problem was the values that I was putting in the final argument, the "value" parameter.

    pageTracker._trackEvent(category, action, label, value)
    

    I was passing non-integer strings to the "value" parameter:

    pageTracker._trackEvent("UserAction", "ShowHelp", "Page", "http://mysite/UrlGoesHere");
    

    but the docs say it needs to be an integer value.

    pageTracker._trackEvent("UserAction", "ShowHelp", "http://mysite/UrlGoesHere",  1);
    

    I posed the question on Google Help Forums here.

    And here is a link to the Event Tracking docs

    Thanks for the help Török

提交回复
热议问题