GTM4WP Order-Escape Patch WordPress Function

Safely patches a GTM4WP bug by intercepting WordPress’s js_escape filter on the order-received page: it detects the current WooCommerce order ID and wraps matching order numbers in quotes, preventing JavaScript data-layer errors and ensuring accurate purchase tracking in Google Tag Manager.

$9.99

Description

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.

Customer Reviews

0 reviews
0
0
0
0
0

There are no reviews yet.

Be the first to review “GTM4WP Order-Escape Patch WordPress Function”

Your email address will not be published. Required fields are marked *