Skip to content
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

add referrer to pubmatic #2

Merged
merged 1 commit into from
Feb 26, 2018
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
5 changes: 5 additions & 0 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function PubmaticAdapter() {
var _pm_pub_gender;
var _pm_pub_kvs;
var _pm_optimize_adslots = [];
var _pm_pub_page_url;
let iframe;

function _callBids(params) {
Expand All @@ -28,6 +29,7 @@ function PubmaticAdapter() {
_pm_pub_age = _pm_pub_age || (bid.params.age || '');
_pm_pub_gender = _pm_pub_gender || (bid.params.gender || '');
_pm_pub_kvs = _pm_pub_kvs || (bid.params.kvs || '');
_pm_pub_page_url = _pm_pub_page_url || (bid.params.referrer || '');
_pm_optimize_adslots.push(bid.params.adSlot);
}

Expand Down Expand Up @@ -61,6 +63,8 @@ function PubmaticAdapter() {
'window.kaddctr = "%%PM_ADDCTR%%";' +
'window.kadgender = "%%PM_GENDER%%";' +
'window.kadage = "%%PM_AGE%%";' +
'window.kadpageurl = "%%PM_PAGE_URL%%";' +
'window.pageURL = "%%PM_PAGE_URL%%";' +
'window.pm_async_callback_fn = "window.parent.$$PREBID_GLOBAL$$.handlePubmaticCallback";';

content += '</scr' + 'ipt>';
Expand All @@ -70,6 +74,7 @@ function PubmaticAdapter() {
map.PM_ADDCTR = _pm_pub_kvs;
map.PM_GENDER = _pm_pub_gender;
map.PM_AGE = _pm_pub_age;
map.PM_PAGE_URL = _pm_pub_page_url;
map.PM_OPTIMIZE_ADSLOTS = _pm_optimize_adslots.map(function (adSlot) {
return "'" + adSlot + "'";
}).join(',');
Expand Down