
: How to pass the Page filename to Google Analytics trackEvent() I want to easily view Events for a particular page in Google Analytics. Is there a way to pass in the page filename to the event
I want to easily view Events for a particular page in Google Analytics.
Is there a way to pass in the page filename to the event call?
e.g.,
_gaq.push(['_trackEvent', 'ACTION-DESCRIPTION', 'ACTION','LABEL-usually-PAGE']);
More posts by @Cody1181609
2 Comments
Sorted by latest first Latest Oldest Best
You can define a variable to store the pathname and then use that variable in the event
var path = document.location.pathname
_gaq.push(['_trackEvent', 'category', 'action', 'path = '+path]);
I would suggest using Google Tag Manager, as it allows you to define variables for event tracking.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.