Skip to content

Commit

Permalink
Fix possible naming collision with other GTM plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
TorbenLundsgaard committed Oct 3, 2023
1 parent dc9ebed commit a8915cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Frontend/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ public function get_datalayer_content(): void {
if ( $this->options->get( 'general', 'gtm_id' ) ) {
$datalayer_data = apply_filters( 'gtmkit_datalayer_content', [] );

echo 'const dataLayer_content = ' . wp_json_encode( $datalayer_data ) . ";\n";
echo 'const gtmkit_dataLayer_content = ' . wp_json_encode( $datalayer_data ) . ";\n";

echo esc_attr( $this->datalayer_name ) . '.push( dataLayer_content );' . "\n";
echo esc_attr( $this->datalayer_name ) . '.push( gtmkit_dataLayer_content );' . "\n";
}

echo "</script>\n";
Expand Down

0 comments on commit a8915cd

Please sign in to comment.