Skip to content

Commit 23c7f68

Browse files
committed
Prefix tag ids for DoubleClick Async
Prefixes the tag ids, because ids must not start with a number in html. This allows the regions to be styled with css. See #73
1 parent 03f53f2 commit 23c7f68

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
@@ -134,7 +134,7 @@ public function filter_output_html( $output_html, $tag_id ) {
134134
$matching_ad_code = $ad_code_manager->get_matching_ad_code( $tag['tag'] );
135135
if ( ! empty( $matching_ad_code ) ) {
136136
?>
137-
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());
137+
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());
138138
<?php
139139
}
140140
endforeach;
@@ -150,9 +150,9 @@ public function filter_output_html( $output_html, $tag_id ) {
150150
break;
151151
default:
152152
$output_script = "
153-
<div id='%tag_id%' style='width:%width%px; height:%height%px;'>
153+
<div id='acm-ad-tag-%tag_id%' style='width:%width%px; height:%height%px;'>
154154
<script type='text/javascript'>
155-
googletag.cmd.push(function() { googletag.display('%tag_id%'); });
155+
googletag.cmd.push(function() { googletag.display('acm-ad-tag-%tag_id%'); });
156156
</script>
157157
</div>
158158
";

0 commit comments

Comments
 (0)