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

module rules #2242

Merged
merged 3 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion _data/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
subgroup: 1

- sbSecId: 0
title: '  Header Bidding Wrapper'
title: '  Header Bidding'
link: /wrapper_code_of_conduct.html
isHeader: 0
isSectionHeader: 0
Expand All @@ -90,6 +90,13 @@
isSectionHeader: 0
subgroup: 0

- sbSecId: 0
title: '  Module Rules'
link: /dev-docs/module-rules.html
isHeader: 0
isSectionHeader: 0
subgroup: 0

- sbSecId: 0
title: "<span style='color:#EA9622;'>Policies</span>"
link:
Expand Down
57 changes: 26 additions & 31 deletions dev-docs/bidder-adaptor.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
layout: page_v2
title: How to Add a New Bidder Adapter
description: Documentation on how to add a new bidder adapter
title: How to Add a New Prebid.js Bidder Adapter
description: Documentation on how to add a Prebid.js new bidder adapter
top_nav_section: dev_docs
nav_section: adapters
sidebarType: 1
---



# How to Add a New Bidder Adapter
# How to Add a New Prebid.js Bidder Adapter
{:.no_toc}

At a high level, a bidder adapter is responsible for:
Expand All @@ -24,35 +24,24 @@ This page has instructions for writing your own bidder adapter. The instruction

## Planning your Adapter

+ [Required Adapter Conventions](#bidder-adaptor-Required-Adapter-Conventions)
+ [Required Adapter Rules](#bidder-adaptor-Required-Adapter-Conventions)
+ [Required Files](#bidder-adaptor-Required-Files)
+ [Designing your Bid Params](#bidder-adaptor-Designing-your-Bid-Params)

<a name="bidder-adaptor-Required-Adapter-Conventions" />

### Required Adapter Conventions
### Required Adapter Rules

In order to provide a fast and safe header bidding environment for publishers, the Prebid.org team reviews all adapters for the following required conventions:
In order to provide a fast and safe header bidding environment for publishers, the Prebid.org team reviews all adapters for the required bid adapter conventions laid out in the [Module Rules](/dev-docs/module-rules.html). Here are additional details specific to Prebid.js:

* *Support multiple instances*: All adapters must support the creation of multiple concurrent instances. This means, for example, that adapters cannot rely on mutable global variables.
* *No loading of external libraries*: All code must be present in the adapter, not loaded at runtime. Exceptions are possible -- see [the full policy](https://github.com/prebid/prebid-js-external-js-template#policy).
* *Must support HTTPS*: Within a secure page context, the request to the bidder's server must also be secure.
* *Compressed responses*: All bid responses from the bidder's server must be gzipped.
* *Bid responses may not use JSONP*: All requests must be AJAX with JSON responses.
* *All user-sync activity must be registered via the provided functions*: The platform will place all registered syncs in the page after the auction is complete, subject to publisher configuration.
* *Adapters may not create or trigger any network requests or pixels* outside of the requests that wrapper creates on behalf of the adapter from the return values of `buildRequests()` and `getUserSyncs()` or are included in a winning and rendered creative.
* *Adapters may not use the `$$PREBID_GLOBAL$$` variable*: Instead, they must load any necessary functions and call them directly.
* *Adapters may not modify ad slots directly*: e.g. Accessing `googletag.pubads().getSlots()` to modify or set targeting directly on slots is not permitted.
* *Adapters may not override standard ad server targeting*: Do not override, or set default values for any of the standard targeting variables: hb_adid, hb_bidder, hb_pb, hb_deal, or hb_size, hb_source, hb_format.
* **No loading of external code**: All code must be present in the adapter, not loaded at runtime. Exceptions are possible -- see [the full policy](https://github.com/prebid/prebid-js-external-js-template#policy).
* **All user-sync activity must be registered via the provided functions**: The platform will place all registered syncs in the page after the auction is complete, subject to publisher configuration.
* **Adapters may not create or trigger any network requests or pixels** outside of the requests the wrapper creates on behalf of the adapter (from the return values of `buildRequests()` and `getUserSyncs()`) or that are included in a winning and rendered creative.
* **Adapters may not modify ad slots directly**: For example, accessing `googletag.pubads().getSlots()` to modify or set targeting directly on slots is not permitted.
* **All parameter conventions must be followed**: Video params must be read from AdUnit.mediaTypes.video when available; however, bidder config can override the ad unit.

{: .alert.alert-danger :}
Failure to follow any of the above conventions could lead to delays in approving your adapter for inclusion in Prebid.js.

{: .alert.alert-danger :}
Pull requests for non-1.0 compatible adapters will not be reviewed or accepted on the legacy branch.

{: .alert.alert-danger :}
Prebid.org does not support any version of Prebid.js prior to version 1.0.
The above list is **not** the full list of requirements. Failure to follow any of the required conventions defined in the [Module Rules](/dev-docs/module-rules.html) could lead to delays in approving your adapter for inclusion in Prebid.js. If you'd like to apply for an exception to one of the rules, make your request in a new [Prebid.js issue](https://github.com/prebid/Prebid.js/issues).

<a name="bidder-adaptor-Required-Files" />

Expand Down Expand Up @@ -288,19 +277,24 @@ Notes on parameters in the bidderRequest object:
- **gdprConsent** is the object containing data from the [GDPR ConsentManagement](/dev-docs/modules/consentManagement.html) module
- **uspConsent** is the object containing data from the [US Privacy ConsentManagement](/dev-docs/modules/consentManagementUsp.html) module

#### Prebid Config
<a name="std-param-location"></a>

There are a number of important values that a publisher can set in the page that your bid adapter may need to take
into account:
#### Prebid Standard Parameter Locations

There are a number of important values that a publisher expects to be handled in a standard way across all Prebid.js adapters:

{: .table .table-bordered .table-striped }
| Value | Description | Example |
| Parameter | Description | Example |
| ----- | ------------ | ---------- |
| Ad Server Currency | If your endpoint supports responding in different currencies, read this value. | config.getConfig('currency.adServerCurrency') |
| Publisher Domain | The page may declare its domain, useful in cross-iframe scenarios. | config.getConfig('publisherDomain') |
| Bidder Timeout | Use if your endpoint needs to know how long the page is allowing the auction to run. | config.getConfig('bidderTimeout'); |
| COPPA | If your endpoint supports the Child Online Privacy Protection Act, you should read this value. | config.getConfig('coppa'); |
| First Party Data | The publisher may provide first party data (e.g. page type). | config.getConfig('fpd'); |
| First Party Data | The publisher may provide [first party data](/dev-docs/publisher-api-reference.html#setConfig-fpd) (e.g. page type). | config.getConfig('fpd'); |
| Floors | Adapters that accept a floor parameter must also support the [floors module](https://docs.prebid.org/dev-docs/modules/floors.html) | [`getFloor()`](/dev-docs/modules/floors.html#bid-adapter-interface) |
| Page Referrer | Intead of building your own function to find the page referrer, look in the standard bidRequest location. | bidderRequest.refererInfo.referer |
| Publisher Domain | The page may declare its domain, useful in cross-iframe scenarios. | config.getConfig('publisherDomain') |
| [Supply Chain](/dev-docs/modules/schain.html) | Adapters cannot accept an schain parameter. Rather, they must look for the schain parameter at bidRequest.schain. | bidRequest.schain |
| Video Parameters | Video params must be read from AdUnit.mediaType.video when available; however bidder config can override the ad unit. | AdUnit.mediaType.video |

#### Referrers

Expand Down Expand Up @@ -790,7 +784,7 @@ function createBid(status, reqBid, response) {
### Deals in Ad Pods

To do deals for long-form video (`adpod` ad unit) just add the `dielTier` integer value to `bid.video.dealTier`. For more details on conducting deals in ad pods see our [ad pod module documentation](/dev-docs/modules/adpod.html).

## Supporting Native

In order for your bidder to support the native media type:
Expand Down Expand Up @@ -1057,4 +1051,5 @@ The Prebid.org [download page](/download.html) will automatically be updated wit

## Further Reading

+ [The bidder adapter sources in the repo](https://github.com/prebid/Prebid.js/tree/master/modules)
+ [Prebid.js Repo - Bidder Adapter Sources](https://github.com/prebid/Prebid.js/tree/master/modules)
+ [Module Rules](/dev-docs/module-rules.html)
20 changes: 11 additions & 9 deletions dev-docs/integrate-with-the-prebid-analytics-api.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: page_v2
title: How to Add an Analytics Adapter
description: How to add an analytics adapter
title: How to Add a Prebid.js Analytics Adapter
description: How to add a Prebid.js analytics adapter
pid: 28
top_nav_section: dev_docs
nav_section: adapters
Expand All @@ -11,7 +11,7 @@ sidebarType: 1



# How to Add an Analytics Adapter
# How to Add a Prebid.js Analytics Adapter
{:.no_toc}

The Prebid Analytics API provides a way to get analytics data from `Prebid.js` and send it to the analytics provider of your choice, such as Google Analytics. Because it's an open source API, you can write an adapter to send analytics data to any provider you like. Integrating with the Prebid Analytics API has the following benefits:
Expand Down Expand Up @@ -45,9 +45,13 @@ Working with any Prebid project requires using Github. In general, we recommend
4. Open a [pull request](https://help.github.com/en/desktop/contributing-to-projects/creating-a-pull-request) to the appropriate repository's master branch with a good description of the feature/bug fix.
5. If there's something that needs to change on the prebid.org website, follow the above steps for the [website repo](https://github.com/prebid/prebid.github.io).

{: .alert.alert-warning :}
Analytics adapters are subject to a number of specific technical rules. Please become familiar
with the [module rules](/dev-docs/module-rules.html) that apply globally and to analytics adapters in particular.

### Step 1: Add a markdown file describing the module

1. Create a markdown file under `modules` with the name of the bidder suffixed with 'AnalyticsAdapter', e.g., `exAnalyticsAdapter.md`
Create a markdown file under `modules` with the name of the bidder suffixed with 'AnalyticsAdapter', e.g., `exAnalyticsAdapter.md`

Example markdown file:
{% highlight text %}
Expand Down Expand Up @@ -148,7 +152,7 @@ Once everything looks good, submit the code, tests, and markdown as a pull reque

### Step 5: Website pull request

There are two files that need to be updated to list your new analytics adapter.
There are two files that need to be updated to list your new analytics adapter.

1. Create a fork of the [website repo](https://github.com/prebid/prebid.github.io) and a branch for your new adapter. (e.g. feature/exAnalyticsAdapter)

Expand All @@ -165,7 +169,5 @@ We sometimes get pretty busy, so it can take a couple of weeks for the review pr

## Further Reading

- [Analytics for Prebid]({{site.baseurl}}/overview/analytics.html) (Overview and list of analytics providers)
- [Integrate with the Prebid Analytics API]({{site.baseurl}}/dev-docs/integrate-with-the-prebid-analytics-api.html) (For developers)


- [Analytics for Prebid](/overview/analytics.html) (Overview and list of analytics providers)
- [Module Rules](/dev-docs/module-rules.html)
Loading