From 7e7b62205d9c280897328089e094e2368a4501f6 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Thu, 22 Dec 2016 13:13:53 +0530 Subject: [PATCH 1/6] PubMatic: passing pageurl in postbid added support to pass pageURL to PubMatic adapter in postbid (Safeframe) implementation please note that we have not added safe frame detection logic --- src/adapters/pubmatic.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/adapters/pubmatic.js b/src/adapters/pubmatic.js index 434097e98c5..aab0085956c 100644 --- a/src/adapters/pubmatic.js +++ b/src/adapters/pubmatic.js @@ -52,6 +52,7 @@ var PubmaticAdapter = function PubmaticAdapter() { content += ''; content += '' + 'window.pm_pub_id = "%%PM_PUB_ID%%";' + + 'window.kadpageurl = "'+ window.document.referrer +'";' + // for postbid safeframe page detection, note that we have not added safe frame detection logic 'window.pm_optimize_adslots = [%%PM_OPTIMIZE_ADSLOTS%%];' + 'window.pm_async_callback_fn = "window.parent.$$PREBID_GLOBAL$$.handlePubmaticCallback";'; content += ''; From dda4db6ef258f1c33ffcd53ba0c09b52343ad1b9 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Tue, 10 Jan 2017 15:46:44 +0530 Subject: [PATCH 2/6] removed code committed accidently in master --- src/adapters/pubmatic.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/adapters/pubmatic.js b/src/adapters/pubmatic.js index aab0085956c..434097e98c5 100644 --- a/src/adapters/pubmatic.js +++ b/src/adapters/pubmatic.js @@ -52,7 +52,6 @@ var PubmaticAdapter = function PubmaticAdapter() { content += ''; content += '' + 'window.pm_pub_id = "%%PM_PUB_ID%%";' + - 'window.kadpageurl = "'+ window.document.referrer +'";' + // for postbid safeframe page detection, note that we have not added safe frame detection logic 'window.pm_optimize_adslots = [%%PM_OPTIMIZE_ADSLOTS%%];' + 'window.pm_async_callback_fn = "window.parent.$$PREBID_GLOBAL$$.handlePubmaticCallback";'; content += ''; From 15210c8354013b86c9eb4f6e62b19015e36cb13f Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Wed, 11 Jan 2017 12:30:54 +0530 Subject: [PATCH 3/6] new function createTrackPixelIframeHtml in util --- src/utils.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/utils.js b/src/utils.js index 3fe2cf3127b..db81beaf8df 100644 --- a/src/utils.js +++ b/src/utils.js @@ -470,6 +470,21 @@ exports.createTrackPixelHtml = function (url) { return img; }; +/** + * Creates a snippet of Iframe HTML that retrieves the specified `url` + * @param {string} url plain URL to be requested + * @return {string} HTML snippet that contains the iframe src = set to `url` + */ +exports.createTrackPixelIframeHtml = function (url) { + if (!url) { + return ''; + } + + return ''; +}; + /** * Returns iframe document in a browser agnostic way * @param {object} iframe reference From 640b3d1990ae9de85dd1f814531bca075293f25e Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Wed, 11 Jan 2017 15:34:59 +0530 Subject: [PATCH 4/6] minor fix in return statement of createTrackPixelIframeHtml --- src/utils.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/utils.js b/src/utils.js index db81beaf8df..096a89fa1e0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -480,9 +480,7 @@ exports.createTrackPixelIframeHtml = function (url) { return ''; } - return ''; + return ''; }; /** From b3b3cb5e00823a4ff447485e46e361c7a7c161cc Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Thu, 19 Jan 2017 18:47:18 +0530 Subject: [PATCH 5/6] PubMatic to execute impression tracker in iframe will use utils.createTrackPixelIframeHtml instead of utils.createTrackPixelHtml --- src/adapters/pubmatic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapters/pubmatic.js b/src/adapters/pubmatic.js index 434097e98c5..c039c4eac7a 100644 --- a/src/adapters/pubmatic.js +++ b/src/adapters/pubmatic.js @@ -118,7 +118,7 @@ var PubmaticAdapter = function PubmaticAdapter() { adResponse.adSlot = bid.adSlot; adResponse.cpm = Number(adUnitInfo.bid); adResponse.ad = unescape(adUnit.creative_tag); // jshint ignore:line - adResponse.ad += utils.createTrackPixelHtml(decodeURIComponent(adUnit.tracking_url)); + adResponse.ad += utils.createTrackPixelIframeHtml(decodeURIComponent(adUnit.tracking_url)); adResponse.width = dimensions[0]; adResponse.height = dimensions[1]; adResponse.dealId = adUnitInfo.wdeal; From 7195aa42f4048c168ce524316eb3b89dcd97afb1 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Wed, 1 Feb 2017 18:05:15 +0530 Subject: [PATCH 6/6] utils.createTrackPixelIframeHtml: using string template literals --- src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 096a89fa1e0..5cceb65d391 100644 --- a/src/utils.js +++ b/src/utils.js @@ -480,7 +480,7 @@ exports.createTrackPixelIframeHtml = function (url) { return ''; } - return ''; + return ``; }; /**