Allow for Standard Google AdWords URLs with gclid
Description of problem
When using Google AdWords, Google appends the URL with tags that include /?gclid=teST123, the DNN URL management rewrites this to /gclid/teST123 and breaks Google Analytics ability to track it.
Description of solution
Add to the UAM setting, AUM_KeepInQueryStringRegex |/gclid/[^/]+
Additional context
http://www.dnnsoftware.com/answers/google-adwords-and-advanced-url-management http://www.dnnsoftware.com/wiki/keeping-querystring-items-out-of-the-url-path-in-dnn
Affected browsers
- [x] All
@Accuraty do you know if the settings are still getting removed when enabling Advanced URLs? I haven't tested this, but my suspicion is they do. If so, it would be ideal to find the root cause of settings removal and fix that.
@david-poindexter - there is still no UI for turning it on/off right? I am assuming you mean changing web.config, <friendUrl> provider. urlFormat defaults in a new DNN 9.x to "advanced". changing that to "humanfriendly" does turn it off (URLs go back to adding .aspx), but the AUM settings do not go away or revert. Turned it back on, no changes in settings. Even checks HostSettings table, all the UAM_ ones are still there (including my custom setting in AUM_KeepInQueryStringRegex).
Or am I misundertanding you?
Interesting note, on a default install of DNN 9.04.02 (or 9.04.03-rc1) none of the AUM_ values are written in to HostSettings table until you actually change and save a setting in the UI; Settings/SEO/Url Management, Expressions. Modify one and save and they all get written. Nothing wrong with that, just an observation (that surprised me).
@Accuraty yeah, I was just wondering if we need to look for "adding" this in the appropriate area(s) or if we indeed still had a problem with AUM settings being removed by some action (e.g. changing from humanfriendly to advanced or vice versa).
Unless I am missing something, this is the only place this RegEx string is defined. DNN Platform/Library/Entities/Urls/FriendlyUrlSettings.cs
I don't know enough about the project, but it doesn't seem like a 'breaking change' to me to simple add |/gclid/[^/]+ to the end of the initial settings on line 260.
I agree, that change should be fine 👍
If anyone ever comes back around to this, there appears to be a related problem with the URL rewrite removing a needed, trailing slash. Details in this StackOverflow post: https://stackoverflow.com/questions/58843942/how-do-i-ensure-google-ads-can-track-the-gclid-on-urls-in-dnn9