From 3423c17aa6a7ec971dfe5077a1a6865a721bf985 Mon Sep 17 00:00:00 2001 From: MartianTribe Date: Tue, 5 Feb 2019 14:50:15 -0500 Subject: [PATCH 1/6] first commit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9ba72e6b8b..48cdda97f6 100755 --- a/README.md +++ b/README.md @@ -184,3 +184,4 @@ In alphabetical order: + ronenst + sberry + studnicky +# SuranieWiki From fdf8aa863d62808174e14edcee1606191ac99c8d Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 18 Mar 2019 11:45:18 -0400 Subject: [PATCH 2/6] Added error message to AMP endpoint doc --- prebid-server/endpoints/openrtb2/amp.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/prebid-server/endpoints/openrtb2/amp.md b/prebid-server/endpoints/openrtb2/amp.md index b5ac98b0f4..cdbe989f35 100644 --- a/prebid-server/endpoints/openrtb2/amp.md +++ b/prebid-server/endpoints/openrtb2/amp.md @@ -95,7 +95,27 @@ A sample response payload looks like this: In [the typical AMP setup]({{site.baseurl}}/dev-docs/show-prebid-ads-on-amp-pages.html), these targeting params will be sent to DFP. -Note that "errors" will only appear if there were any errors generated. They are identical to the "errors" field in the response.ext of the OpenRTB endpoint. +### Error Messages + +If any errors were generated they will appear within `response.ext.errors.{bidderName}`. There are five error codes that could be returned: + +``` +0 NoErrorCode +1 TimeoutCode +2 BadInputCode +3 BadServerResponseCode +999 UnknownErrorCode +``` + +See the [/openrtb2/auction endpoint](/prebid-server/endpoints/openrtb2/auction.html) for a description of some common openRTB errors. The following is a list of AMP specific errors that could be returned: + +| Task | Code | Message | Action | +|---|---|---|---| +| Returning auction data | 3 | Critical error. | status set to `StatusInternalServerError` and return | +| Extracting the targeting parameters from the response | 3 | Critical error while unpacking AMP targets. | status set to `StatusInternalServerError` and return | +| Extract error from response | 999 | AMP response: failed to unpack OpenRTB response.ext, debug info cannot be forwarded. | Error is logged | +| | | | | + ### Query Parameters From b6e1ddd2e44a7ee2229e11bf515a7df76258b1b2 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 18 Mar 2019 14:09:22 -0400 Subject: [PATCH 3/6] Fixed some punctuation. --- prebid-server/endpoints/openrtb2/amp.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/prebid-server/endpoints/openrtb2/amp.md b/prebid-server/endpoints/openrtb2/amp.md index cdbe989f35..7ba563f33b 100644 --- a/prebid-server/endpoints/openrtb2/amp.md +++ b/prebid-server/endpoints/openrtb2/amp.md @@ -111,9 +111,22 @@ See the [/openrtb2/auction endpoint](/prebid-server/endpoints/openrtb2/auction.h | Task | Code | Message | Action | |---|---|---|---| -| Returning auction data | 3 | Critical error. | status set to `StatusInternalServerError` and return | -| Extracting the targeting parameters from the response | 3 | Critical error while unpacking AMP targets. | status set to `StatusInternalServerError` and return | -| Extract error from response | 999 | AMP response: failed to unpack OpenRTB response.ext, debug info cannot be forwarded. | Error is logged | +| Returning auction data. | 3 | Critical error. | status set to `StatusInternalServerError`. | +| Extracting the targeting parameters from the response. | 3 | Critical error while unpacking AMP targets. | status set to `StatusInternalServerError`. | +| Extract error from response. | 999 | AMP response: failed to unpack OpenRTB response.ext, debug info cannot be forwarded. | Error is logged. | +| Adding debug information. | 999 | Test set on request but debug not present in response. | Error is logged. | +| Encoding the response. | 999 | `/openrtb2/amp` failed to send response. | Error is logged. | +| | | | | + +The following errors can occur when loading a stored OpenRTB request for an incoming AMP request. + +| Task | Code | Message | Action | +|---|---|---|---| +| Query check for tag_id. | 999 | AMP requests require an AMP tag_id. | Error is returned. | +| Checking stored request for match against tag_id. | 999 | No AMP config found for tag_id `%s`. | Error is returned. | +| Checking if imp exists. | 999 | Data for tag_id=`'%s'` does not define the required imp array. | Error is returned. | +| Checking if imp count is greater than one. | 999 | Data for tag_id `'%s'` includes `%d` imp elements. Only one is allowed. | Error is returned. | +| Checking if request.app exists. | 999 | `r`equest.app` must not exist in AMP stored requests. | Error is returned. | | | | | | From 17f9738d4c8d4168e11d502efd8d420eae4c5245 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 18 Mar 2019 14:47:43 -0400 Subject: [PATCH 4/6] Fixed some of the document flow --- prebid-server/endpoints/openrtb2/amp.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/prebid-server/endpoints/openrtb2/amp.md b/prebid-server/endpoints/openrtb2/amp.md index 7ba563f33b..fd28bf406f 100644 --- a/prebid-server/endpoints/openrtb2/amp.md +++ b/prebid-server/endpoints/openrtb2/amp.md @@ -11,16 +11,22 @@ This document describes the behavior of the Prebid Server AMP endpoint in detail For a more general reference, see the [Prebid AMP Implementation Guide ]({{site.baseurl}}/dev-docs/show-prebid-ads-on-amp-pages.html). -## `GET /openrtb2/amp?tag_id={ID}` +## AMP Endpoint -The `tag_id` ID must reference a [Stored BidRequest]({{site.baseurl}}/prebid-server/developers/stored-requests.html). -For a thorough description of BidRequest JSON, see the [/openrtb2/auction](./auction.html) docs. + `GET /openrtb2/amp?tag_id={ID}` + + **Parameters** + + {: .table .table-bordered .table-striped } +| Param | Scope | Type | Description | +| --- | --- | --- | --- | +| tag_id | Required | `String` | The `tag_id` ID must reference a [Stored BidRequest]({{site.baseurl}}/prebid-server/developers/stored-requests.html). For a thorough description of BidRequest JSON, see the [/openrtb2/auction](./auction.html) docs. | To be compatible with AMP, this endpoint behaves slightly different from normal `/openrtb2/auction` requests. 1. The Stored `request.imp` data must have exactly one element. 2. `request.imp[0].secure` will be always be set to `1`, because AMP requires all content to be `https`. -3. AMP query params will overwrite parts of your Stored Request. For details, see the Query Params section. +3. AMP query params will overwrite parts of your Stored Request. For details, see the [Query Params](#query_params) section. ### Request @@ -109,6 +115,7 @@ If any errors were generated they will appear within `response.ext.errors.{bidd See the [/openrtb2/auction endpoint](/prebid-server/endpoints/openrtb2/auction.html) for a description of some common openRTB errors. The following is a list of AMP specific errors that could be returned: +{: .table .table-bordered .table-striped } | Task | Code | Message | Action | |---|---|---|---| | Returning auction data. | 3 | Critical error. | status set to `StatusInternalServerError`. | @@ -120,6 +127,7 @@ See the [/openrtb2/auction endpoint](/prebid-server/endpoints/openrtb2/auction.h The following errors can occur when loading a stored OpenRTB request for an incoming AMP request. +{: .table .table-bordered .table-striped } | Task | Code | Message | Action | |---|---|---|---| | Query check for tag_id. | 999 | AMP requests require an AMP tag_id. | Error is returned. | @@ -129,7 +137,7 @@ The following errors can occur when loading a stored OpenRTB request for an inco | Checking if request.app exists. | 999 | `r`equest.app` must not exist in AMP stored requests. | Error is returned. | | | | | | - + ### Query Parameters This endpoint supports the following query parameters: From c9a51e93f386a3bcb3c57dbf668bc06be20b8ef0 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 22 Mar 2019 13:10:37 -0400 Subject: [PATCH 5/6] updated amp process --- prebid-server/endpoints/openrtb2/amp.md | 33 ++++++++++++++++++------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/prebid-server/endpoints/openrtb2/amp.md b/prebid-server/endpoints/openrtb2/amp.md index fd28bf406f..61b5ec5534 100644 --- a/prebid-server/endpoints/openrtb2/amp.md +++ b/prebid-server/endpoints/openrtb2/amp.md @@ -20,7 +20,7 @@ For a more general reference, see the [Prebid AMP Implementation Guide {: .table .table-bordered .table-striped } | Param | Scope | Type | Description | | --- | --- | --- | --- | -| tag_id | Required | `String` | The `tag_id` ID must reference a [Stored BidRequest]({{site.baseurl}}/prebid-server/developers/stored-requests.html). For a thorough description of BidRequest JSON, see the [/openrtb2/auction](./auction.html) docs. | +| tag_id | Required | `String` | The `tag_id` ID must reference a [Stored BidRequest]({{site.baseurl}}/prebid-server/developers/stored-requests.html). For a thorough description of bid request JSON, see the [/openrtb2/auction](./auction.html) docs. | To be compatible with AMP, this endpoint behaves slightly different from normal `/openrtb2/auction` requests. @@ -34,7 +34,7 @@ Valid Stored Requests for AMP pages must contain an `imp` array with exactly one An example Stored Request is given below: -``` +```javascript { "id": "some-request-id", "site": { @@ -56,7 +56,7 @@ An example Stored Request is given below: "imp": [ { "id": "some-impression-id", - "banner": {}, // The sizes are defined is set by your AMP tag query params + "banner": {}, // The sizes are defined by your AMP tag query params settings "ext": { "appnexus": { // Insert parameters here @@ -74,7 +74,7 @@ An example Stored Request is given below: A sample response payload looks like this: -``` +```javascript { "targeting": { "hb_bidder": "appnexus", @@ -123,7 +123,7 @@ See the [/openrtb2/auction endpoint](/prebid-server/endpoints/openrtb2/auction.h | Extract error from response. | 999 | AMP response: failed to unpack OpenRTB response.ext, debug info cannot be forwarded. | Error is logged. | | Adding debug information. | 999 | Test set on request but debug not present in response. | Error is logged. | | Encoding the response. | 999 | `/openrtb2/amp` failed to send response. | Error is logged. | -| | | | | + The following errors can occur when loading a stored OpenRTB request for an incoming AMP request. @@ -134,8 +134,8 @@ The following errors can occur when loading a stored OpenRTB request for an inco | Checking stored request for match against tag_id. | 999 | No AMP config found for tag_id `%s`. | Error is returned. | | Checking if imp exists. | 999 | Data for tag_id=`'%s'` does not define the required imp array. | Error is returned. | | Checking if imp count is greater than one. | 999 | Data for tag_id `'%s'` includes `%d` imp elements. Only one is allowed. | Error is returned. | -| Checking if request.app exists. | 999 | `r`equest.app` must not exist in AMP stored requests. | Error is returned. | -| | | | | +| Checking if request.app exists. | 999 | `request.app` must not exist in AMP stored requests. | Error is returned. | + ### Query Parameters @@ -152,9 +152,24 @@ This endpoint supports the following query parameters: - A configuration option `amp_timeout_adjustment_ms` may be set to account for estimated latency so that Prebid Server can handle timeouts from adapters and respond to the AMP RTC request before it times out. 8. `debug` - When set to `1`, the respones will contain extra info for debugging. -For information on how these get from AMP into this endpoint, see [this pull request adding the query params to the Prebid callout](https://github.com/ampproject/amphtml/pull/14155) and [this issue adding support for network-level RTC macros](https://github.com/ampproject/amphtml/issues/12374). +Ensure that the amp-ad component was imported in the header. + +```html + + ``` + +This script provides code libraries that will convert the `` properties to the endpoint query parameters. In the most basic usage pass `width` and `height` as well as `type` and a `rtc-config`. The `type` value is the ad network you will be using. The `rtc-config` is used to pass JSON configuration to the Prebid Server, which handles the communication with [AMP RTC](https://medium.com/ampfuel/better-than-header-bidding-amp-rtc-fc54e80f3999). Vendors is an object that defines any vendors that will be receiving the RTC callout. In this example, the required parameter `tag_id` will receive the `PLACEMENT_ID` value. + +```html + + rtc-config='{"vendors": {"prebidappnexus": {"PLACEMENT_ID": "ef8299d0-cc32-46cf-abcd-41cebe8b4b85"}}, "timeoutMillis": 500}' + +``` -If present, these will override parts of your Stored Request. +If any of the enpoint parameters are present, they will override parts of your Stored Request. 1. `ow`, `oh`, `w`, `h`, and/or `ms` will be used to set `request.imp[0].banner.format` if `request.imp[0].banner` is present. 2. `curl` will be used to set `request.site.page` From 1fea6817dc1811bbce23419166cb31f8a08071a5 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 22 Mar 2019 13:18:28 -0400 Subject: [PATCH 6/6] Making edits per comments --- prebid-server/endpoints/openrtb2/amp.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/prebid-server/endpoints/openrtb2/amp.md b/prebid-server/endpoints/openrtb2/amp.md index 61b5ec5534..6e2d721253 100644 --- a/prebid-server/endpoints/openrtb2/amp.md +++ b/prebid-server/endpoints/openrtb2/amp.md @@ -26,7 +26,7 @@ To be compatible with AMP, this endpoint behaves slightly different from normal 1. The Stored `request.imp` data must have exactly one element. 2. `request.imp[0].secure` will be always be set to `1`, because AMP requires all content to be `https`. -3. AMP query params will overwrite parts of your Stored Request. For details, see the [Query Params](#query_params) section. +3. AMP query params will overwrite parts of your Stored Request. For details, see the [Query Parameters](#query_params) section. ### Request @@ -113,7 +113,7 @@ If any errors were generated they will appear within `response.ext.errors.{bidd 999 UnknownErrorCode ``` -See the [/openrtb2/auction endpoint](/prebid-server/endpoints/openrtb2/auction.html) for a description of some common openRTB errors. The following is a list of AMP specific errors that could be returned: +See the [/openrtb2/auction endpoint](/prebid-server/endpoints/openrtb2/auction.html) for a description of some common OpenRTB errors. The following is a list of AMP specific errors that could be returned: {: .table .table-bordered .table-striped } | Task | Code | Message | Action | @@ -168,6 +168,12 @@ This script provides code libraries that will convert the `` properties rtc-config='{"vendors": {"prebidappnexus": {"PLACEMENT_ID": "ef8299d0-cc32-46cf-abcd-41cebe8b4b85"}}, "timeoutMillis": 500}' ``` +The endpoint is rewritten as: + +``` +/openrtb2/amp?tag_id='ef8299d0-cc32-46cf-abcd-41cebe8b4b85'&w=300&h=250&timeout=500 +``` + If any of the enpoint parameters are present, they will override parts of your Stored Request.