Skip to content

Commit

Permalink
Dable: add new optional params for categories (#38995)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeesoo-dable committed May 23, 2023
1 parent 114c1fe commit 7f777dc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ads/vendors/dable.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,23 @@ export function dable(global, data) {

const itemId = data['itemId'] || '';
const channel = data['channel'] || '';
const articleSection = data['articleSection'] || '';
const articleSection2 = data['articleSection2'] || '';
const articleSection3 = data['articleSection3'] || '';
const opts = {};

if (channel) {
opts.channel = channel;
}
if (articleSection) {
opts.category1 = articleSection;
}
if (articleSection2) {
opts.category2 = articleSection2;
}
if (articleSection3) {
opts.category3 = articleSection3;
}

if (itemId) {
global.dable('sendLog', 'view', {id: itemId});
Expand Down
5 changes: 5 additions & 0 deletions ads/vendors/dable.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
type="dable"
data-widget-id="jobgqR7W"
data-item-id="testitem"
data-article-section="politics"
data-article-section2="global"
>
</amp-embed>
```
Expand All @@ -28,3 +30,6 @@ For configuration details and to generate your tags, please contact https://admi
- `data-item-id`
- `data-service-name`
- `data-channel`
- `data-article-section`
- `data-article-section2`
- `data-article-section3`

0 comments on commit 7f777dc

Please sign in to comment.