Skip to content

Commit d22b706

Browse files
Merge pull request #74 from nickdaugherty/master
Prefix tag ids in DoubleClick Async provider. Props @nickdaugherty
2 parents 162f935 + 23c7f68 commit d22b706

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

providers/doubleclick-for-publishers-async.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function filter_output_html( $output_html, $tag_id ) {
169169
// and the same tag id ( which is just a div id ). This confuses DFP Async, so we need to make sure
170170
// that tags are unique
171171
?>
172-
googletag.defineSlot('/<?php echo esc_attr( $matching_ad_code['url_vars']['dfp_id'] ); ?>/<?php echo esc_attr( $matching_ad_code['url_vars']['tag_name'] ); ?>', [<?php echo (int)$tt['width'] ?>, <?php echo (int)$tt['height'] ?>], "<?php echo esc_attr( $matching_ad_code['url_vars']['tag_id'] ); ?>").addService(googletag.pubads());
172+
googletag.defineSlot('/<?php echo esc_attr( $matching_ad_code['url_vars']['dfp_id'] ); ?>/<?php echo esc_attr( $matching_ad_code['url_vars']['tag_name'] ); ?>', [<?php echo (int)$tt['width'] ?>, <?php echo (int)$tt['height'] ?>], "acm-ad-tag-<?php echo esc_attr( $matching_ad_code['url_vars']['tag_id'] ); ?>").addService(googletag.pubads());
173173
<?php
174174
}
175175
endforeach;
@@ -185,9 +185,9 @@ public function filter_output_html( $output_html, $tag_id ) {
185185
break;
186186
default:
187187
$output_script = "
188-
<div id='%tag_id%' style='width:%width%px; height:%height%px;'>
188+
<div id='acm-ad-tag-%tag_id%' style='width:%width%px; height:%height%px;'>
189189
<script type='text/javascript'>
190-
googletag.cmd.push(function() { googletag.display('%tag_id%'); });
190+
googletag.cmd.push(function() { googletag.display('acm-ad-tag-%tag_id%'); });
191191
</script>
192192
</div>
193193
";

0 commit comments

Comments
 (0)