Tracking
Tracking with WordPress
Where to put the tracking snippet on WordPress, and how script-delay, cookie banner and cache plugins get in the way.
Server-side tracking via Rentware (GA4, Google Ads, Meta) needs nothing on WordPress except a cookie banner that sends Google Consent Mode v2. For browser events (dataLayer, Google Tag Manager, Meta pixel) you add a small snippet yourself. This article covers what our plugin does and the WordPress plugins that most often break tracking.
What our Elementor plugin does, and doesn’t
The plugin “Rentware Widgets for Elementor” loads the widget script and sets your access token and language. It does not add tracking: no RTR_HOOKS, no Google Tag Manager, no Meta pixel, no consent handling. Your cookie banner and your tags stay your own.
Where to put the snippet
The widget sends events to your tags only when the page defines window.RTR_HOOKS. For Google Tag Manager:
<script>
window.RTR_HOOKS = Object.assign(window.RTR_HOOKS || {}, {
enableDataLayer: true,
})
</script>
Put it in one of these places:
- Your theme’s header (for example “Custom code” in your theme settings, or
header.phpof a child theme). - A code snippets plugin (for example WPCode or Code Snippets), as a snippet in the header on every page.
- A Google Tag Manager tag: a Custom HTML tag with the trigger “Initialization – All Pages”.
The snippet only has to exist before the first event (add to cart); it doesn’t have to load before the widget. All options are in the developer reference.
Script-delay plugins
WP Rocket (“Delay JavaScript execution”), LiteSpeed Cache, Autoptimize, Perfmatters and similar plugins delay scripts until the visitor interacts with the page. That can delay the widget, or the cookie banner, so the consent isn’t in the dataLayer yet when the visitor books. The tracking log then shows skipped: no consent signal (see Reading the tracking log).
Exclude these from delaying and combining:
cdn.rtr-io.com(the Rentware widgets)- your cookie banner’s script
- the Google tag (
googletagmanager.com) and the Meta pixel, if you use them
Cookie banners that block scripts automatically
Complianz, Cookiebot, Borlabs and other consent plugins with auto-blocking can block cdn.rtr-io.com/widgets.js itself. Then no widget appears at all until the visitor accepts. The widget script is needed for booking, not a tracking script: mark it as functional or necessary, or exclude it from blocking.
At the same time, turn on Google Consent Mode v2 in the banner’s settings. Without it, Rentware receives no consent signals and sends no server-side events.
Caching
Page caches (WP Rocket, LiteSpeed, your host’s cache, Cloudflare) keep serving the old page after you change the snippet or the banner. Clear the cache after every change and test in a private window.
Events from a “partner integration” in Meta
Meta events with IDs like ob3_plugin-set_… or labeled as a partner integration come from a WordPress plugin on your site (for example a Meta or WooCommerce plugin), not from Rentware.