Skip to content

Commit

Permalink
Add ad units event (#1702)
Browse files Browse the repository at this point in the history
* Adding an addAdUnits event

* Fixing errors
  • Loading branch information
hhhjort authored and dbemiller committed Oct 17, 2017
1 parent 209921c commit 5bfcdc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions src/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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);
};

/**
Expand Down

0 comments on commit 5bfcdc4

Please sign in to comment.