Skip to content

Commit 463f453

Browse files
committed
Set ad configuration values if using explicit placement
This only applies if the project is setting an explicit placement. This sets the values sanely
1 parent 892db33 commit 463f453

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

readthedocs/core/static-src/core/js/doc-embed/sponsorship.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ function create_ad_placement() {
3232
var offset;
3333

3434
if ($(EXPLICIT_PLACEMENT_SELECTOR).length > 0) {
35+
$(EXPLICIT_PLACEMENT_SELECTOR).attr("data-ea-publisher", "readthedocs");
36+
$(EXPLICIT_PLACEMENT_SELECTOR).attr("data-ea-manual", "true");
37+
if ($(EXPLICIT_PLACEMENT_SELECTOR).attr("data-ea-type") !== "image" && $(EXPLICIT_PLACEMENT_SELECTOR).attr("data-ea-type") !== "text") {
38+
$(EXPLICIT_PLACEMENT_SELECTOR).attr("data-ea-type", "readthedocs-sidebar");
39+
}
3540
return $(EXPLICIT_PLACEMENT_SELECTOR);
3641
} else if ($(OLD_EXPLICIT_PLACEMENT_SELECTOR).length > 0) {
3742
selector = OLD_EXPLICIT_PLACEMENT_SELECTOR;

0 commit comments

Comments
 (0)