Skip to content

Commit

Permalink
AdYoulike Bid Adapter: Add an "Insertion" tracking for Native mediaty…
Browse files Browse the repository at this point in the history
…pe (#6481)

* add insertion event

* add missing campaign ID parameter

* update unit test with new tracking checked
  • Loading branch information
guiann authored Mar 31, 2021
1 parent 1e73b57 commit 5cc4405
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion modules/adyoulikeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,12 @@ function getNativeAssets(response, nativeConfig) {

var impressionUrl = adJson.TrackingPrefix +
'/pixel?event_kind=IMPRESSION&attempt=' + adJson.Attempt;
var insertionUrl = adJson.TrackingPrefix +
'/pixel?event_kind=INSERTION&attempt=' + adJson.Attempt;

if (adJson.Campaign) {
impressionUrl += '&campaign=' + adJson.Campaign;
insertionUrl += '&campaign=' + adJson.Campaign;
}

native.clickUrl = adJson.TrackingPrefix + '/ar?event_kind=CLICK&attempt=' + adJson.Attempt +
Expand All @@ -355,7 +358,7 @@ function getNativeAssets(response, nativeConfig) {
native.impressionTrackers = [];
}

native.impressionTrackers.push(impressionUrl);
native.impressionTrackers.push(impressionUrl, insertionUrl);
}

Object.keys(nativeConfig).map(function(key, index) {
Expand Down
3 changes: 2 additions & 1 deletion test/spec/modules/adyoulikeBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,8 @@ describe('Adyoulike Adapter', function () {
},
impressionTrackers: [
'https://testPixelIMP.com/fake',
'https://tracking.omnitagjs.com/tracking/pixel?event_kind=IMPRESSION&attempt=a11a121205932e75e622af275681965d&campaign=f1c80d4bb5643c222ae8de75e9b2f991'
'https://tracking.omnitagjs.com/tracking/pixel?event_kind=IMPRESSION&attempt=a11a121205932e75e622af275681965d&campaign=f1c80d4bb5643c222ae8de75e9b2f991',
'https://tracking.omnitagjs.com/tracking/pixel?event_kind=INSERTION&attempt=a11a121205932e75e622af275681965d&campaign=f1c80d4bb5643c222ae8de75e9b2f991'
],
javascriptTrackers: [
'https://testJsIMP.com/fake.js'
Expand Down

0 comments on commit 5cc4405

Please sign in to comment.