Skip to content

Commit 9779166

Browse files
authored
Fix child identifiers in Doubleclick SRA IUs. (#35891)
1 parent 017c5a8 commit 9779166

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

extensions/amp-ad-network-doubleclick-impl/0.1/sra-utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ export function combineInventoryUnits(impls) {
8282
const prevIusEncoded = [];
8383
impls.forEach((instance) => {
8484
const iu = devAssert(instance.element.getAttribute('data-slot'));
85-
const componentNames = iu.split('/');
85+
const componentNames = iu
86+
.split('/')
87+
.map((componentName) => componentName.replace(/,/g, ':'));
8688
const encodedNames = [];
8789
for (let i = 0; i < componentNames.length; i++) {
8890
if (componentNames[i] == '') {

extensions/amp-ad-network-doubleclick-impl/0.1/test/test-doubleclick-sra.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ describes.realWin('Doubleclick SRA', config, (env) => {
132132
element: {
133133
getAttribute: (name) => {
134134
expect(name).to.equal('data-slot');
135-
return '/1234/foo.com/news/world/2018/06/17/article';
135+
return '/1234,5678/foo.com/news/world/2018/06/17/article';
136136
},
137137
},
138138
});
139139
}
140140
expect(combineInventoryUnits(impls)).to.jsonEqual({
141-
'iu_parts': '1234,foo.com,news,world,2018,06,17,article',
141+
'iu_parts': '1234:5678,foo.com,news,world,2018,06,17,article',
142142
'enc_prev_ius': '0/1/2/3/4/5/6/7,0/1/2/3/4/5/6/7',
143143
});
144144
});

0 commit comments

Comments
 (0)