Skip to content

Commit

Permalink
Merge pull request #31 from humanmade/fix-incorrect-data-layer-object
Browse files Browse the repository at this point in the history
Fix incorrect data type for first data layer object
  • Loading branch information
roborourke authored Jul 18, 2022
2 parents d33c1fe + 8a102c7 commit 0f7c9b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function get_gtm_tag( string $container_id, array $data_layer = [], string $data

if ( ! empty( $data_layer ) ) {
$tag .= sprintf(
'<script>window.%1$s = window.%1$s || []; window.%1$s.push([ %2$s ]);</script>',
'<script>window.%1$s = window.%1$s || []; window.%1$s.push( %2$s );</script>',
$data_layer_var,
wp_json_encode( $data_layer )
);
Expand Down

0 comments on commit 0f7c9b6

Please sign in to comment.