trumans1
trumans1

Reputation: 183

Detecting a server-side re-direct in KRL

Our KRL extension has an interesting tracking problem. Basically we're one of many publishers of merchant links for CJ (commission junction). CJ requests that if another publisher appends afsrc=1 to their re-direct URL, no browser extension will load on the resulting merchant page.

We have coded our extension to respect this parameter with the document.referrer tag, which works great as long as the URL that loads before the merchant page has it in the URL. This flow is:

  1. User goes to another publisher page
  2. User Clicks on a merchant page
  3. User Sees a page and the URL has afsrc=1 in it
  4. User is re-directed to the merchant page

Our extension works as it should with this kind of flow. The problem is if it is a server side re-direct which would be the following flow:

  1. User goes to another publisher page
  2. User Clicks on a merchant page
  3. The publisher does a server side re-direct with afsrc=1 in the url that the user does NOT see
  4. User is re-directed to the merchant page

As far as I can tell, I don't see a way to look for that parameter in the case of a server side re-direct. Does KRL provide a way to look at the last few headers or URLs the browser has seen regardless of if the user actually saw them?

Upvotes: 3

Views: 331

Answers (1)

TelegramSam
TelegramSam

Reputation: 2790

KRL currently only allows response to URLs that the user loads in their browser, and not the redirect path taken to get there. If there is anything visible in the header tags on the page indicating such a flow, the Kynetx JS runtime can be extended to pass that value into a request.

I'm a little surprised that CJ would require monitoring of redirect flow on every merchant site to detect such a flow. Some docs from CJ explaining such a requirement would be helpful.

Upvotes: 3

Related Questions