Open pcvandamcb opened 7 years ago
Can you show your code? Specifically how you're requiring the cleanUrlTracker
plugin and what options you're passing?
window.ga("require", "cleanUrlTracker", {
urlFieldsFilter: function(fieldsObj, parseUrl) {
console.log(fieldsObj);
return fieldsObj;
}
});
I minimised the case to this. No other options and also removed other plugins and just ran this one.
I'm not seeing that. Do you have this hosted live anywhere? Here's what I'm seeing:
And as you can see I'm using the same options you are:
<!doctype html>
<html>
<head>
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-12345-1', 'auto');
ga('require', 'cleanUrlTracker', {
urlFieldsFilter: function(fieldsObj, parseUrl) {
console.log(fieldsObj);
return fieldsObj;
}
});
ga('send', 'pageview');
</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
<script async src="https://rawgit.com/googleanalytics/autotrack/master/autotrack.js"></script>
</head>
<body>
</body>
</html>
Thank you. Unfortunately there is no live example I can show. I will have to do some more research into what is different on our end that causes this behaviour. Will update this post if it is something you should know.
I'm trying to use the cleanUrlTracker functionality to strip out e-mail addresses from our page views. I'm running into the issue that when I check the fieldsObj, the page property is sometimes encoded and sometimes not.
When I do a request for
https://mydomain.com/page?someparam=1
the resulting fieldsObj is as expected:However when I request
https://mydomain.com/?someparam=1
the resulting fieldsObj is as such:(note that it also adds an extra slash in front)
Any idea what is going on here?