remove automatically utm_* google analytics parameter from url
Closed this issue · 10 comments
lots of links have campaing tracking parameters in the url which should not be stored in the database (and also make the link very long). I know this can be very tricky but i think it's possible ;)
found this ruby example: http://stackoverflow.com/questions/12822347/how-can-i-remove-google-tracking-parameters-utm-from-an-url
and this javascript example: https://gist.github.com/paulirish/626834
maybe that helps.
maybe it's also possible to use the canonical meta tag if that's available?
@simonschaufi Good tip. We'll look into this.
@simonschaufi I'm putting together release 1.5.6 and thought of including this. Would you like to take a swing at it and send a Pull Request?
@cdevroe i have an idea already but i need to have a deeper look into the code.
@simonschaufi If you don't get the chance, I'll tackle it after I button up #52.
@simonschaufi @kyleruane and I were talking a day or two ago about this issue. We wondered if we'd be good web citizens for removing this cruft? While the URL would look much nicer I'm unsure if we'd be unfair to the publisher. They are using this information to track referrals and while Unmark would be the referral in this instance... somehow you originally got the link from another source that included all of that information.
I wonder if we should leave this in but perhaps hide it from showing up in the app?
My opinion here is that i already visited this url with the special "campaign" parameters. When i save the bookmark in unmark, the link has no direct relation any more to the campaign. The referrer is still tracked but just the campaign info is gone but thats ok imho.
I'm more interested in the uniqueness of the link since when i save the link again without the parameters, i will have a duplicate in my db.
These are very good points. The way bookmarks are currently added (from the actual page), it makes sense to remove the utm_ string because, as @simonschaufi said, it has already served its purpose.
Google isn't the only game in town... are there any other services that adds cruft to a URL that we'd like to look for as well?
@simonschaufi If you want to pull this feature branch and give it a whirl. I did some local testing and it seems to work.
I had to add a helper. http_build_url is an extremely useful function that cuts down on a lot of code. But is only available via PECL. So I added a helper for those that do not have PECL.
Thanks for your feedback on this.
This is now available for testing in the Milestone 1.6 branch.