Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Invibes Adapter #2202

Merged
merged 13 commits into from
Mar 7, 2018
Merged

Add Invibes Adapter #2202

merged 13 commits into from
Mar 7, 2018

Conversation

rcheptanariu
Copy link
Contributor

Type of change

  • New bidder adapter

Description of change

Added Invibes adapter to connect to Invibes for bids

  • test parameters for validating bids
{
  bidder: 'invibes',
  params: {
    placementId: '12345'
  }
}

@snapwich snapwich assigned snapwich and jaiminpanchal27 and unassigned snapwich Feb 28, 2018

export const spec = {
code: CONSTANTS.BIDDER_CODE,
aliases: [CONSTANTS.BIDDER_CODE],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no reason to do this. It will replace your already registered adapter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't understand where the mistake is. If I don't export, my tests are failing because I can't import the spec. If I don't register the spec, my bidder is not called

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcheptanariu I should have explained it in detail.
By adding aliases: [CONSTANTS.BIDDER_CODE], you are re-registering the adapter as you are using the same constant.
So you should remove the line aliases: [CONSTANTS.BIDDER_CODE] or use some different alias.

});

const topWin = getTopMostWindow();
var invibes = topWin.invibes = topWin.invibes || {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use let/const

.replace('creativeHtml', bidModel.CreativeHtml);
}

function getCappedCampaignsAsString() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this function ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a campaign capping functionality that limits the amount of times the user should get an ad from the respective campaign, in a given time frame. An id is stored in localStorage, together with a view count and a timestamp.
That function returns a formatted parameter that we send from the adapter to our system to know if the campaign can be displayed again at the moment, to the current user.

}

/// Local domain cookie management =====================
var Uid = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you share how are you using these cookie functions and what is their purpose ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ivNoCookie -> no cookies should be set for the user
ivbsdid -> a user id cookie. The entire 'Uid' +'initDomainId' is logic is for filtering (the user must return at least several times in multiple days. Else it is considered a temporary id and not sent with the bid request)
IvbsCampIdsLocal -> list of clicked campaign ids of the user
random test cookie -> to check for top cookie domain. We remove it afterwards

ttl: CONSTANTS.TIME_TO_LIVE,
ad: renderCreative(bidModel),

placementCode: bidRequest.placementCode
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add placementCode in bidResponse here.

@jaiminpanchal27
Copy link
Collaborator

Also need a docs PR before merge. Please submit a PR to the docs repo to add a file for your adapter to the bidders directory so your adapter's params will appear on the bidders page. Thank you for contributing

@rcheptanariu
Copy link
Contributor Author

Docs PR at: prebid/prebid.github.io#638
Thank you!

@rcheptanariu
Copy link
Contributor Author

Can you please confirm if the updates have been done as requested?
Thank you very much!

const key = 'ivvcap';

let loadData = function () {
return JSON.parse(localStorage.getItem(key)) || {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any JSON.parse calls should be within a try/catch block

@matthewlane matthewlane merged commit b0260d5 into prebid:master Mar 7, 2018
Millerrok pushed a commit to Vertamedia/Prebid.js that referenced this pull request Mar 15, 2018
* 'master' of https://github.com/prebid/Prebid.js: (76 commits)
  Updated adUnitCode (prebid#2262)
  vastUrl is set based on nurl for video. (prebid#2249)
  Added ad id to a4g bid (prebid#2250)
  Add billing url (burl) support (prebid#2246)
  Fix: add mediatype in bid response (prebid#2260)
  use b64EncodeUnicode to encode strings with unicode chars in them (prebid#2245)
  create RELEASE_SCHEDULE.md (prebid#2255)
  Update Platform.io Adapter (prebid#2230)
  Update Lifestreet adapter to 1.0 (prebid#2197)
  PBS adapter not sending app or device (prebid#2206)
  Fix prebid#2229 - Edge cookie string form (prebid#2236)
  Add Invibes Adapter (prebid#2202)
  Increment pre version
  Prebid 1.5.0 Release
  Fix cross-platform test failures (prebid#2228)
  Fix uncahced video bids from multi-response array triggering callback early (prebid#2219)
  Add vuble adapter (prebid#2201)
  Update Vidazoo domain (prebid#2223)
  InSkin Bid Adapter: remove referrer field from request body (prebid#2217)
  Gamma Support UserSync Endpoint (prebid#2216)
  ...
mizmaar3 added a commit to widespace-os/Prebid.js that referenced this pull request Mar 19, 2018
* master:
  Audience Network: Add 'pbv' and 'cb' query params (prebid#2252)
  Add e-planning analytics adapter (prebid#2211)
  Add vastUrl for Gamma Adapter Video (prebid#2261)
  update params for test bid (prebid#2267)
  Updated adUnitCode (prebid#2262)
  vastUrl is set based on nurl for video. (prebid#2249)
  Added ad id to a4g bid (prebid#2250)
  Add billing url (burl) support (prebid#2246)
  Fix: add mediatype in bid response (prebid#2260)
  use b64EncodeUnicode to encode strings with unicode chars in them (prebid#2245)
  create RELEASE_SCHEDULE.md (prebid#2255)
  Update Platform.io Adapter (prebid#2230)
  Update Lifestreet adapter to 1.0 (prebid#2197)
  PBS adapter not sending app or device (prebid#2206)
  Fix prebid#2229 - Edge cookie string form (prebid#2236)
  Add Invibes Adapter (prebid#2202)
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
* Added invibes adapter

* added domain id & config

* invibes bid adapter - auction start and logging

* invibes bid adapter refactor

* Invibes Bid Adapter - renames

* Invibes Bid Adapter - fix typo

* Invibes Adapter - test spec

* Invibes Adapter - added size to test params

* Invibes Bid Adapter - lint fix

* Invibes Adapter - lint fix in test spec

* Invibes Bid Adapter - review change requests

* Invibes Bid Adapter - remove alias according to review change requests

* Invibes Bid Adapter - review change request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants