diff --git a/src/constants.json b/src/constants.json index a4649e09c31..806b3790c12 100644 --- a/src/constants.json +++ b/src/constants.json @@ -32,7 +32,8 @@ "BID_RESPONSE": "bidResponse", "BID_WON": "bidWon", "SET_TARGETING": "setTargeting", - "REQUEST_BIDS": "requestBids" + "REQUEST_BIDS": "requestBids", + "ADD_AD_UNITS": "addAdUnits" }, "EVENT_ID_PATHS": { "bidWon": "adUnitCode" diff --git a/src/prebid.js b/src/prebid.js index 4d94fb475ce..4aeb5482100 100644 --- a/src/prebid.js +++ b/src/prebid.js @@ -28,6 +28,7 @@ const { syncUsers, triggerUserSyncs } = userSync; var BID_WON = CONSTANTS.EVENTS.BID_WON; var SET_TARGETING = CONSTANTS.EVENTS.SET_TARGETING; +var ADD_AD_UNITS = CONSTANTS.EVENTS.ADD_AD_UNITS; var auctionRunning = false; var bidRequestQueue = []; @@ -447,6 +448,8 @@ $$PREBID_GLOBAL$$.addAdUnits = function (adUnitArr) { adUnitArr.transactionId = utils.generateUUID(); $$PREBID_GLOBAL$$.adUnits.push(adUnitArr); } + // emit event + events.emit(ADD_AD_UNITS); }; /**