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

How to do configure a bidder alias? #780

Closed
joyofdata opened this issue Nov 8, 2016 · 15 comments
Closed

How to do configure a bidder alias? #780

joyofdata opened this issue Nov 8, 2016 · 15 comments
Assignees

Comments

@joyofdata
Copy link
Contributor

Sekindo contacted us with the information that their adapter won't work for a while (in conjunction with some fundamental changes in prebid.js introduced in the most recent version 0.14.0) and we should switch to AppNexus. But especially because we use the bidder names to distinguish the networks for our reporting I need to keep using the name "sekindo". If I am not mistaken pbjs.aliasBidder("appnexus","sekindo"); should accomplish exactly that - but it didn't.

So here's what I did - using the Postbid example code to illustrate - two changes at (A) and (B):

<html>
<head>
<script>
  var tagWidth = 300;
  var tagHeight = 250;

  var bids = [{
      bidder: 'appnexus',
      params: {
         placementId: '4799418'
      }
    }, 
    {
      bidder: 'sekindo',
      params: {
          // (A) now placementId with new value provided by Sekindo for a given placement
          // spaceId: '12345'
          placementId: '54321'
      }
    }
  ];
    
  var bidTimeOut = 1000;

  var passbackTagHtml = '<scr' + 'ipt type='text/javascript' src='https://www.googletagservices.com/tag/js/gpt.js'>googletag.pubads().definePassback('/19968/header-bid-passback-tag', [300, 250]).display();</scr' + 'ipt>'
</script>

<script type="text/javascript" src="//acdn.adnxs.com/prebid/not-for-prod/prebid.js" async></script>

<script>
  var pbjs = pbjs || {};
  pbjs.que = pbjs.que || [];

  var doNotChange = 'doNotChange';

  pbjs.que.push(function() {

    // (B) Here I specify that "sekindo" is supposed to use the "appnexus" adapter
    pbjs.aliasBidder("appnexus","sekindo");

    var adUnits = [{
      code: doNotChange,
      sizes: [[tagWidth, tagHeight]],
      bids: bids
    }];

    pbjs.addAdUnits(adUnits);

    pbjs.requestBids({
      timeout: bidTimeOut,
      bidsBackHandler: function() {
        var iframe = document.getElementById('postbid_if');
        var iframeDoc = iframe.contentWindow.document;
        var params = pbjs.getAdserverTargetingForAdUnitCode(doNotChange);

        if (params && params['hb_adid']){
          pbjs.renderAd(iframeDoc, params['hb_adid']);
        } else {
          iframe.width = tagWidth;
          iframe.height = tagHeight;
          iframeDoc.write(passbackTagHtml);
        }
      }
    });
  });
</script>
</head>

<body style="margin:0;padding:0">
<iframe id='postbid_if' FRAMEBORDER="0" SCROLLING="no" MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN="0" LEFTMARGIN="0" ALLOWTRANSPARENCY="true" WIDTH="0" HEIGHT="0"></iframe>
</body>

</html>

For some reason though this leads to no more bids being received from Sekindo.

What am I doing wrong?

@joyofdata
Copy link
Contributor Author

It seems that it is necessary to place pbjs.aliasBidder("appnexus","sekindo"); after pbjs.addAdUnits(adUnits);.

Another possibility is to configure the alias in adapters.json before building.

{
  "appnexus": {
    "alias": "brealtime"
  }
}

@stagingUser
Copy link

stagingUser commented Mar 6, 2017

@joyofdata

Is building with alias in adaptors.json sufficient or we need to do pbjs.aliasBidder("appnexus","districtm"); all the time ?

1 similar comment
@Sandeep-Patel
Copy link

@joyofdata

Is building with alias in adaptors.json sufficient or we need to do pbjs.aliasBidder("appnexus","districtm"); all the time ?

@joyofdata
Copy link
Contributor Author

@Sandeep-Patel
building with alias in adapter.json is sufficient

@digitalthrottle
Copy link

Questions:

a. Do we post a Git Hub request to add "digitalthrottle" as an Alias? We've been sending our AppNexus placement ID to our publishers and it's creating confusion.

b. Can we instruct the publisher on how to directly update their own adapters.json file to add us as an alias or is this a common JSON controlled by Pre-Bid.

Thanks for the help!

@mkendall07
Copy link
Member

@digitalthrottle
aliases are currently controlled via each adapter file. You should submit a PR to add an alias.

@pboisso
Copy link

pboisso commented Nov 4, 2017

How about the bidCpmAdjustment settings for the alias? It seems that even if we use an alias for a second 'appnexus' partner, there is only one 'appnexus' bidCpmAdjustment called and not for the alias one.

@mhmgdk
Copy link

mhmgdk commented Nov 13, 2017

Hi,

What are the build parameters for building with alias adapters?
I tried the following and it failed:

gulp build --modules=modules.json,adapters.json

@mkendall07
Copy link
Member

@pboisso
You need to setup the bidAdjustment for the alias as well.
@mhmgdk

You can see build instructions in the readme here: https://github.com/prebid/Prebid.js#Build

@pboisso
Copy link

pboisso commented Nov 14, 2017

Thanks @mkendall07 , I finally got it to work. I've never been able to send the alias to S2S however (despite the fact that it's an AppNexus alias, thus supporting S2S).

@dbemiller
Copy link
Contributor

That makes sense... unfortunately Prebid Server doesn't support Aliases yet, so there's not much Prebid.JS can do about it.

There is/was some discussion here: prebid/prebid-server#11

Feel free to chime in with thumbs up or any details about your needs.

@mhmgdk
Copy link

mhmgdk commented Nov 14, 2017

@mkendall07
The build instructions does mention how to build with a limited set of modules, but not how to include aliasing in the build.
The modules.json file in the instructions contains a regular array and the adapters.json file contains an associative array according to comment from @joyofdata, so the format is different. Is there a command line option to gulp that includes a adapters.json file containing an associative array of adapter aliases?

@mkendall07
Copy link
Member

@mhmgdk
No, we don't offer a build time alias function any longer.

@mhmgdk
Copy link

mhmgdk commented Nov 14, 2017

@mkendall07
I see. I found some old documentation suggesting
gulp build --adapters adapters.json
But the resulting prebid.js file does not contain the aliases, so I guess that the build command at some point has been replaced with
gulp build --modules=modules.json
without including the support for aliasing and thereby the option to build prebid.js with aliasing support for the moment. Right?
So I guess that setting
pbjs.aliasBidder("bidder","alias");
is the only option for now?

@mkendall07
Copy link
Member

@mhmgdk
correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants