Cookie Consent Banner With Google Consent Mode
Shows a simple Accept / Reject cookie banner, sets Google Consent Mode v2 defaults to "denied" until the visitor accepts, and remembers the choice for six months.
Snippet Library
Snippets for analytics and tracking: add Google Analytics, Tag Manager or ad pixels, exclude logged-in users and track clicks or form sends. For marketers who want the tracking code in place without editing the theme.
Shows a simple Accept / Reject cookie banner, sets Google Consent Mode v2 defaults to "denied" until the visitor accepts, and remembers the choice for six months.
Sends a Google Analytics 4 "purchase" event with the order total and downloads when a customer lands on the Easy Digital Downloads purchase confirmation page.
Sends a Google Analytics 4 "purchase" event with the order ID, value, tax, shipping and items when a customer reaches the order received page, once per order.
Sends a GA4 "begin_checkout" event with the cart value and items when the customer opens the checkout page.
Sends GA4 ecommerce events when a shopper views a product page and when they add a product to the cart, from the product page or with AJAX buttons on shop pages.
Loads the Google Ads tag and reports a purchase conversion with the order value and transaction ID on the WooCommerce order received page.
Adds the Google Analytics 4 (gtag.js) tracking code to the head of every public page.
Outputs the GA4 tag only for visitors and customers, so your own visits as an author, editor or administrator do not skew the statistics.
Sets Google Consent Mode defaults before any Google tag loads, denying ad and analytics storage for visitors in the EEA, UK and Switzerland until your consent tool grants it.
Adds the HTML meta tag Google Search Console uses to verify that you own the site.
Adds the Google Tag Manager noscript fallback right after the opening body tag. Use it together with the GTM head snippet.
Adds the Google Tag Manager container script to the head of every page. Use it together with the GTM body snippet.
Detects visitors whose browser sends a Global Privacy Control (GPC) or Do Not Track signal and updates Google Consent Mode to deny ad storage and personalization for them.
Pushes page information (page type, post type, categories, author, publish date and login status) to the dataLayer before Google Tag Manager loads, for use in tags and triggers.
Pushes scroll_depth events to the Google Tag Manager dataLayer when visitors scroll 25, 50, 75 and 90 percent of a page, to measure how far content is read.
Sets GA4 user properties for whether the visitor is logged in and their role (for example customer or subscriber), so you can compare members and guests in reports.
Tells Google Analytics 4 which category, author and post type each page belongs to, so you can see which topics and writers bring the most engagement.
Sends a page_not_found event to Google Analytics 4 with the broken URL and the page the visitor came from, so you can find and fix dead links.
Sends an event to Google Analytics 4 (or the GTM dataLayer) whenever a visitor clicks a phone number, email address or WhatsApp link, so you can count leads from these contacts.
Sends a search_no_results event with the search term to Google Analytics 4 when a site search finds nothing, showing you what visitors want but cannot find.
Pushes a GA4-style "purchase" ecommerce object to the Google Tag Manager dataLayer on the order received page, ready for GA4, Google Ads or Meta tags in GTM.