dnnsoftware / Dnn.Platform

DNN (formerly DotNetNuke) is the leading open source web content management platform (CMS) in the Microsoft ecosystem.
https://dnncommunity.org/
MIT License
1.03k stars 749 forks source link

Allow for Standard Google AdWords URLs with gclid #3336

Open jeremy-farrance opened 4 years ago

jeremy-farrance commented 4 years ago

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

david-poindexter commented 4 years ago

@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.

jeremy-farrance commented 4 years ago

@david-poindexter - there is still no UI for turning it on/off right? I am assuming you mean changing web.config, 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?

jeremy-farrance commented 4 years ago

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).

david-poindexter commented 4 years ago

@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).

jeremy-farrance commented 4 years ago

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.

bdukes commented 4 years ago

I agree, that change should be fine 👍

jeremy-farrance commented 4 months ago

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