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

✨ ENHANCE: expand widgetOpts/logOpts #39433

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 9 additions & 1 deletion ads/vendors/dable.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export function dable(global, data) {
'setService',
data['serviceName'] || global.window.context.location.hostname
);
global.dable('setURL', global.window.context.sourceUrl);
global.dable(
'setURL',
global.window.context.canonicalUrl || global.window.context.sourceUrl
);
global.dable('setRef', global.window.context.referrer);

const slot = global.document.createElement('div');
Expand All @@ -34,6 +37,7 @@ export function dable(global, data) {
const articleSection = data['articleSection'] || '';
const articleSection2 = data['articleSection2'] || '';
const articleSection3 = data['articleSection3'] || '';
const orgServiceId = data['orgServiceId'] || '';
const widgetOpts = {};
const logOpts = {};

Expand All @@ -52,6 +56,10 @@ export function dable(global, data) {
widgetOpts.category3 = articleSection3;
logOpts.category3 = articleSection3;
}
if (orgServiceId) {
widgetOpts.orgServiceId = orgServiceId;
logOpts.orgServiceId = orgServiceId;
}

if (itemId) {
logOpts.id = itemId;
Expand Down
5 changes: 4 additions & 1 deletion ads/vendors/dable.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
height="200"
type="dable"
data-widget-id="jobgqR7W"
data-service-name="testservice"
data-item-id="testitem"
data-article-section="politics"
data-article-section2="global"
data-org-service-id="1"
>
</amp-embed>
```
Expand All @@ -24,12 +26,13 @@ For configuration details and to generate your tags, please contact https://admi
### Required parameters

- `data-widget-id`
- `data-service-name`

### Optional parameters

- `data-item-id`
- `data-service-name`
- `data-channel`
- `data-article-section`
- `data-article-section2`
- `data-article-section3`
- `data-org-service-id`