Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript file embedded by Disqus ("alfie.f51946af45e0b561c60f768335c9eb79.js") and redirect in its code

I just noticed this JavaScript file is embedded in many pages of my site where Disqus comments is enabled.

http://a.disquscdn.com/next/embed/alfie.f51946af45e0b561c60f768335c9eb79.js

Any idea what is its purpose?

I found out that it automatically adds a click event listener to every link (both internal and external links) and the click event does some redirection. It was not a significant problem until I realized the redirection was affecting many links to an external website I have in my site and all of them ended up in the home page.

Its not a matter of my URL's build to the external website in href or parameters as copy pasting the URL directly into browser (no redirection) works fine.

Is this a Disqus feature for tracking or something that can be configured?

Screenshot of click event listener (Firefox debug)

like image 700
user5151986 Avatar asked Nov 18 '15 09:11

user5151986


2 Answers

It's the "Affiliate links" enabled option in Disqus Setup > Advanced

https://help.disqus.com/customer/portal/articles/851667-affiliate-guide

like image 109
user5151986 Avatar answered Nov 03 '22 12:11

user5151986


Updated help article link:

https://help.disqus.com/customer/en/portal/articles/2425431-how-to-disable-affiliate-linking

Affiliate linking is an optional feature that automatically replaces outbound product links on your site with affiliate links,

To disable or enable affiliate linking, visit the Admin > Settings > Advanced.

like image 41
Ben Leivian Avatar answered Nov 03 '22 12:11

Ben Leivian