Skip to content

Commit

Permalink
pbjs.renderAd Doc: Updated to include details about the ${CLICKTHROUG…
Browse files Browse the repository at this point in the history
…H} macro feature (prebid#4176)

* updated docs for ${CLICKTHROUGH} macro with renderAd func

* spacing update to md file
  • Loading branch information
jlquaccia authored and ecdrsvc committed Sep 6, 2023
1 parent 6a8f078 commit 116ac26
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion dev-docs/publisher-api-reference/renderAd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: api_prebidjs
title: pbjs.renderAd(doc, id)
title: pbjs.renderAd(doc, id, options)
description:
---

Expand All @@ -9,9 +9,22 @@ This function will render the ad (based on params) in the given iframe document

**Kind**: static method of pbjs API

`options.clickThrough` optionally enables publishers to count clicks on prebid inventory in their distributing adserver.
The publisher may call renderAd with a third param accepting an object where the value of clickThrough will be checked.
If this property is set the value of clickThrough will replace any occurrence of ${CLICKTHROUGH} inside of the properties ad and adUrl. If no match is found nothing will be replaced.

{: .alert.alert-info :}
Note: In regards to `options.clickThrough`:
- To make use of this feature, bid adapters would be required to respond with ad tags including the ${CLICKTHROUGH} macro.
- The renderAd function must be invoked with the options argument. Ex: `renderAd(doc, bidId, {clickThrough: 'https://someadserverclickurl.com'});`
- Not compatible with safeframes (since the logic around rendering safeframe's does not invoke the renderAd function).
- Not supported with Prebid Universal Creative at this time, only the standard pbjs.renderAd method.


{: .table .table-bordered .table-striped }
| Param | Scope | Type | Description |
| --- | --- | --- | --- |
| doc | Required | `object` | document |
| id | Required | `string` | bid id to locate the ad |
| options | Optional | `object` | object containing other additional params to be used (listed below) |
| options.clickThrough | Optional | `string` | a url used to keep track of clicks on the ad to be rendered (used to resolve the ${CLICKTHROUGH} macro) |

0 comments on commit 116ac26

Please sign in to comment.