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 Dable AMP options #39413

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@powerivq these don't get obfuscated?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's up to Dable whether to do something about these parameters.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erwinmombay Thank you for the review 🙏
It's an internally agreed value, so I don't think it'll be a problem but please let me know if you have any concerns.

logOpts.orgServiceId = orgServiceId;
}

if (itemId) {
logOpts.id = itemId;
Expand Down
2 changes: 2 additions & 0 deletions ads/vendors/dable.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
data-item-id="testitem"
data-article-section="politics"
data-article-section2="global"
data-org-service-id="1"
>
</amp-embed>
```
Expand All @@ -33,3 +34,4 @@ For configuration details and to generate your tags, please contact https://admi
- `data-article-section`
- `data-article-section2`
- `data-article-section3`
- `data-org-service-id`