angular-google-analytics icon indicating copy to clipboard operation
angular-google-analytics copied to clipboard

How to set a custom page when sending an event?

Open muiscatron opened this issue 7 years ago • 2 comments

I am tracking pageviews and events in my application. I used the regular expression method setRemoveRegExp to filter out sensitive information from page urls, and this worked OK. However, when I send events, the default page associated with the event does not have this filtering applied, and the sensitive information is still visible in the Pages report which is within the Google Analytics "Events" reporting section. I tried to apply a custom "page" property to the trackevent method call like this:

this.Analytics.trackEvent('category', 'action', '', value, false, { page: '/home' });

But it does not seem to work. When I look at network traffic in the browser debugger, it has the actual full URL populated in the "dl" parameter. The 'dp' parameter is being set correctly to the custom page property value. But this alone does not seem to prevent google analytics from recording the sensitive URL. Is there any way to have complete control of the page details when sending an Event?

muiscatron avatar Jan 18 '17 10:01 muiscatron

Further information: When I call trackEvent and send the value parameter as null, dp property is never set in the collection api. If I set any value such as 0, the dp property is set using the page property value.

muiscatron avatar Jan 18 '17 11:01 muiscatron

+1

iamvenkat45 avatar Jun 05 '17 20:06 iamvenkat45