Tracking of internal links w/ query parameters


(Alex Leventer) #1

It looks like there are some issues w/ the link tracking redirect if the url includes query parameters.

Example:

Link is: http://gradle.org/?_ga=2.226839005.1500090099.1519943860-1260396229.1519172786

When I click the link, I’ve directed to the following URL to track the click:

https://discuss.gradle.org/clicks/track?url=http%3A%2F%2Fgradle.org%2F%3F_ga%3D2.172303715.1500090099.1519943860-1260396229.1519172786&post_id=73843&topic_id=26072

I should then be redirected to the original link (http://gradle.org/?_ga=2.226839005.1500090099.1519943860-1260396229.1519172786) but I instead see a blank screen:


(Jeff Atwood) #2

That link works fine for me here, so no repro?


(Jay Pfaffman) #3

If I click on the second (tracking link) I too get a blank page. Chrome and Firefox on ubuntu.


(Jeff Atwood) #4

That’s not the link in question:

http://gradle.org/?_ga=2.226839005.1500090099.1519943860-1260396229.1519172786

This is.


(Alex Leventer) #5

Clicking the first link http://gradle.org/?_ga=2.226839005.1500090099.1519943860-1260396229.15191727865, generates the following tracked link: https://discuss.gradle.org/clicks/track?url=http%3A%2F%2Fgradle.org%2F%3F_ga%3D2.172303715.1500090099.1519943860-1260396229.1519172786&post_id=73843&topic_id=26072 which does not redirect properly:


(Alex Leventer) #6

Here’s a better example:

image


(Jeff Atwood) #7

I think this is specific to the domain that’s local to your site. It works here because it is an external domain.

I believe @techapj has looked at this before, any advice?


(Alex Leventer) #8

Any advice on this @techAPJ?


(Arpit Jalan) #9

Both the links are opening just fine for me as anon or as a logged in user. Are you still seeing this issue.


(Alex Leventer) #10

Thanks for the help @techAPJ

I see a blank screen when I click the following link: https://discuss.gradle.org/clicks/track?url=http%3A%2F%2Fgradle.org%2F%3F_ga%3D2.172303715.1500090099.1519943860-1260396229.1519172786&post_id=73843&topic_id=26072

(Rather than being redirected after the click is tracked)


(Arpit Jalan) #11

Hmm… that is strange. I just tried again on latest Chrome with my user preference Open all external links in a new tab enabled and disabled, and in both cases it worked just fine.

Can you try again with all browser plugins disabled, or try to repro this on any other browser?

Also, it’s strange that the Google Analytics (__ga) parameter is getting added for you when you click on the link, while there is no such parameter in the link posted.


(Alex Leventer) #12

The __ga parameter is added by the Google Analytics Linker plugin.

This is super strange - just tried again in Safari and see the following:


(Arpit Jalan) #15

I see, this is the root cause of error. I use uBlock Origin to disable ads/tracking. Disabling it, I can repro the issue too.

Looking into a fix now.


(Arpit Jalan) #17

Hi again Alex,

To fix this issue, please modify the JavaScript code you added for “Google Analytics Linker” plugin to add a class no-track-link to the target link. Doing that, the Discourse click tracking code will not come into action and hence the white page issue will be solved.