diff --git a/src/native.js b/src/native.js index a56097398327..39f0599feb6a 100644 --- a/src/native.js +++ b/src/native.js @@ -144,6 +144,7 @@ export function fireNativeTrackers(message, adObject) { } (trackers || []).forEach(triggerPixel); + return message.action; } /** diff --git a/src/secureCreatives.js b/src/secureCreatives.js index 32ad27a04961..0d388ae81c7a 100644 --- a/src/secureCreatives.js +++ b/src/secureCreatives.js @@ -46,7 +46,9 @@ function receiveMessage(ev) { // adId: '%%PATTERN:hb_adid%%' // }), '*'); if (data.message === 'Prebid Native') { - fireNativeTrackers(data, adObject); + const trackerType = fireNativeTrackers(data, adObject); + if (trackerType === 'click') { return; } + auctionManager.addWinningBid(adObject); events.emit(BID_WON, adObject); } diff --git a/test/spec/native_spec.js b/test/spec/native_spec.js index 3a016145fd22..0acc3cc253f2 100644 --- a/test/spec/native_spec.js +++ b/test/spec/native_spec.js @@ -68,7 +68,8 @@ describe('native.js', function () { }); it('fires click trackers', function () { - fireNativeTrackers({ action: 'click' }, bid); + const trackerType = fireNativeTrackers({ action: 'click' }, bid); + expect(trackerType).to.equal('click'); sinon.assert.calledOnce(triggerPixelStub); sinon.assert.calledWith(triggerPixelStub, bid.native.clickTrackers[0]); });