GTM4WP Order-Escape Patch WordPress Function
What it does?
-
Hooks into WordPress’s
js_escape
filter to intercept the order-received page output. -
Detects the current WooCommerce order ID (via
?order=
or the pretty-permalink query var). -
When the escaping routine encounters that exact order number, it safely pads the value with quotes—preventing Google Tag Manager for WooCommerce (GTM4WP) from breaking its JavaScript data layer.
Why it’s useful?
-
Fixes a Known GTM4WP Bug: Stops analytics scripts from crashing when the order number is interpreted as raw JS.
-
Accurate Tracking: Ensures purchase events are pushed to GTM without syntax errors, preserving conversion data.
-
Seamless Customer Experience: Keeps the “Thank-you” page error-free, protecting brand credibility and user trust.
Reviews
Clear filtersThere are no reviews yet.