Skip to content

Send referrer in /jpt call #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/adapters/appnexus.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ var AppNexusAdapter = function AppNexusAdapter() {
var memberId = utils.getBidIdParamater('memberId', bid.params);
var inventoryCode = utils.getBidIdParamater('invCode', bid.params);
var query = utils.getBidIdParamater('query', bid.params);
var referrer = utils.getBidIdParamater('referrer', bid.params);
var altReferrer = utils.getBidIdParamater('alt_referrer', bid.params);


//build our base tag, based on if we are http or https

Expand All @@ -109,6 +112,8 @@ var AppNexusAdapter = function AppNexusAdapter() {
jptCall = utils.tryAppendQueryString(jptCall, 'member_id', memberId);
jptCall = utils.tryAppendQueryString(jptCall, 'code', inventoryCode);



//sizes takes a bit more logic
var sizeQueryString = utils.parseSizesInput(bid.sizes);
if (sizeQueryString) {
Expand All @@ -124,9 +129,13 @@ var AppNexusAdapter = function AppNexusAdapter() {
}

//append referrer
jptCall = utils.tryAppendQueryString(jptCall, 'referrer', utils.getTopWindowUrl());


if(referrer===''){
referrer = utils.getTopWindowUrl();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still necessary?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is good, default will be topWindow URL. Thanks

}

jptCall = utils.tryAppendQueryString(jptCall, 'referrer', referrer);
jptCall = utils.tryAppendQueryString(jptCall, 'alt_referrer', altReferrer);

//remove the trailing "&"
if (jptCall.lastIndexOf('&') === jptCall.length - 1) {
jptCall = jptCall.substring(0, jptCall.length - 1);
Expand Down