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

Support win notifications #70

Closed
bretg opened this issue Jul 24, 2019 · 4 comments
Closed

Support win notifications #70

bretg opened this issue Jul 24, 2019 · 4 comments

Comments

@bretg
Copy link
Contributor

bretg commented Jul 24, 2019

Prebid Server is accepting events as outlined in prebid/prebid-server#800. It's also generating event ad targeting as hb_winurl and 'hb_bidid', e.g.

                    "ext": {
                        "prebid": {
                            "type": "banner",
                            "targeting": {
                                "hb_winurl": ""hb_winurl":"https%3A%2F%2Fprebid-server.rubiconproject.com%2Fevent%3Ft%3Dwin%26b%3DBIDID%26a%3D1001%26f%3Di",
                                "hb_bidid_rubicon": "4b61fbb6-d864-4a36-b3dc-ef860d104601",
                                "hb_size_rubicon": "300x250",
                                "hb_cache_id": "731bd2a2-7f84-4080-b499-550a45d4fb9e",
                                "hb_cache_path_rubicon": "/cache",
                                "hb_cache_host_rubicon": "prebid-cache-us-west.rubiconproject.com",
                                "hb_pb": "1.20",
                                "hb_pb_rubicon": "1.20",
                                "hb_cache_id_rubicon": "731bd2a2-7f84-4080-b499-550a45d4fb9e",
                                "hb_cache_path": "/cache",
                                "hb_size": "300x250",
                                "hb_bidder": "rubicon",
                                "hb_bidder_rubicon": "rubicon",
                                "hb_cache_host": "prebid-cache-us-west.rubiconproject.com"
                            },

To reduce the footprint of the ad targeting variables the proposal here is to send the whole URL only once, then for each bidder supply the BIDID. So the first two targeting variables combine.

So now it's time to have the universal creative look for the existence of hb_winurl and hb_bidid_BIDDECODE, hitting the endpoint when appropriate.

The proposed ad server representation is to add a couple of new entries: ucTagData.winurl and ucTagData.winbidid:

<script src = "https://cdn.jsdelivr.net/npm/prebid-universal-creative@latest/dist/creative.js"></script>
<script>
  var ucTagData = {};
  ucTagData.adServerDomain = "";
  ucTagData.pubUrl = "%%PATTERN:url%%";
  ucTagData.adId = "%%PATTERN:hb_adid_BIDDERCODE%%";
  ucTagData.cacheHost = "%%PATTERN:hb_cache_host_BIDDERCODE%%";
  ucTagData.cachePath = "%%PATTERN:hb_cache_path_BIDDERCODE%%";
  ucTagData.uuid = "%%PATTERN:hb_cache_id_BIDDERCODE%%";
  ucTagData.mediaType = "%%PATTERN:hb_format_BIDDERCODE%%";
  ucTagData.env = "%%PATTERN:hb_env%%";
  ucTagData.size = "%%PATTERN:hb_size_BIDDERCODE%%";
  ucTagData.hbPb = "%%PATTERN:hb_pb_BIDDERCODE%%";
  ucTagData.winurl = "%%PATTERN:hb_winurl%%";
  ucTagData.winbidid = "%%PATTERN:hb_bidid_BIDDERCODE%%";

  try {
    ucTag.renderAd(document, ucTagData);
  } catch (e) {
    console.log(e);
  }
</script>

The proposal is that we update the renderAd() function to:

  • do a level of decoding on the hb_winurl (needed to be passed through the %%PATTERN%%)
  • Resolve the 'BIDID' macro in winurl with the value of winbidid
  • If there's any problem with this process but hb_winurl exists, log a warning and skip
  • Add the URL to an invisible image similar to the PBJS triggerpixel function in https://github.com/prebid/Prebid.js/blob/master/src/utils.js
@harpere
Copy link
Contributor

harpere commented Sep 26, 2019

@bretg shouldn't the examples include hb_bidid in addition to hb_bidid_rubicon? that's how most of the other params work, and I see that mentioned at least once in prebid/prebid-server#800. though I suppose it doesn't matter if the ad-server is using ucTagData.winbidid = "%%PATTERN:hb_bidid_BIDDERCODE%%";?

@bretg
Copy link
Contributor Author

bretg commented Oct 2, 2019

@harpere - the idea here is that the creative in GAM will be either specific to a bidder, in which case the AdOps person will enter ucTagData.winbidid = "%%PATTERN:hb_bidid_BIDDERCODE%%", or the creative is using the highest bid, in which case they'll use ucTagData.winbidid = "%%PATTERN:hb_bidid%%"

And because the AdOps person is choosing the winner, there's no need for hb_bidid_BIDDER

@bretg
Copy link
Contributor Author

bretg commented Oct 2, 2019

FYI - I did some testing with the merged code and found a problem -- GAM won't pass a full URL with ampersands in it through to PUC. Updated the description to call for a level of unencoding. Prebid Server will be updated to encode hb_winurl.

@bretg
Copy link
Contributor Author

bretg commented Jan 29, 2020

This was released with 1.6

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

2 participants