Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions includes/class-wc-google-gtag-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ function %2$s(){dataLayer.push(arguments);}
esc_js( $this->get( 'ga_id' ) ),
esc_js( $this->tracker_function_name() ),
esc_js( static::DEVELOPER_ID ),
wp_json_encode( $this->get_consent_modes() ),
wp_json_encode( $this->get_site_tag_config() )
wp_json_encode( $this->get_consent_modes(), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ),
wp_json_encode( $this->get_site_tag_config(), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES )
)
)
);
Expand Down Expand Up @@ -162,6 +162,7 @@ public function inline_script_data(): void {
'events' => $this->get_enabled_events(),
'identifier' => $this->get( 'ga_product_identifier' ),
),
JSON_HEX_TAG | JSON_UNESCAPED_SLASHES
),
)
);
Expand Down Expand Up @@ -246,7 +247,7 @@ public function append_script_data( string $type, $data ): void {
* @return string
*/
public function get_script_data(): string {
return wp_json_encode( $this->script_data );
return wp_json_encode( $this->script_data, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES );
}

/**
Expand Down