Skip to content

Commit

Permalink
🐛 Add subid support to TrafficStars Ad (#37107)
Browse files Browse the repository at this point in the history
* Add subid support to trafficstars ad

* Remove exess subid atrribute from trafficstars ad

* Fix trafficstars ad docs
  • Loading branch information
setdream committed Dec 6, 2021
1 parent 4df29d5 commit 0457155
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ads/vendors/trafficstars.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@ import {loadScript, validateData} from '#3p/3p';
import {parseJson} from '#core/types/object/json';

const requiredParams = ['spot'];
const jsonParams = ['nativeSettings', 'wrapperStyles', 'iFrameStyles'];
const jsonParams = [
'nativeSettings',
'wrapperStyles',
'iFrameStyles',
'queriesParams',
];
const params = [
'uploadLink',
'queriesParams',
'onLoadResponseHook',
'onSpotRenderedHook',
'onLoadErrorHook',
'subid',
'subid_1',
'subid_2',
'subid_3',
'subid_4',
'subid_5',
];
const optionalParams = params.concat(jsonParams);
const adContainerId = 'trafficstars_id';
Expand Down
12 changes: 12 additions & 0 deletions ads/vendors/trafficstars.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ Serves ads from the [TrafficStars](https://www.trafficstars.com/).
data-on-load-response-hook="{(data: TMasterSpotData) => void}"
data-on-spot-rendered-hook="{(element: HTMLElement) => void}"
data-on-load-error-hook="{() => void}"
data-subid="{string}"
data-subid_1="{string}"
data-subid_2="{string}"
data-subid_3="{string}"
data-subid_4="{string}"
data-subid_5="{string}"
>
</amp-embed>
```
Expand All @@ -40,3 +46,9 @@ For details on the configuration semantics, please contact the ad network or ref
- `onLoadResponseHook` - hook after ad request success
- `onSpotRenderedHook` - hook after ad render success
- `onLoadErrorHook` - hook after ad request error
- `subid` - attribute of data
- `subid_1` - attribute of data
- `subid_2` - attribute of data
- `subid_3` - attribute of data
- `subid_4` - attribute of data
- `subid_5` - attribute of data

0 comments on commit 0457155

Please sign in to comment.