Preloader Close

How to Set Up Conversion Tracking in WordPress

Creative Website Design & Development

How to Set Up Conversion Tracking in WordPress

Conversion tracking in WordPress measures when visitors complete valuable actions like form submissions, purchases or phone calls on your site. You set it up by connecting Google Analytics 4 and Google Tag Manager to your WordPress installation then defining conversion events that match your business goals. Accurate tracking turns raw traffic data into actionable revenue intelligence.

What Counts as a Conversion on a WordPress Site

A conversion is any action a visitor takes that moves them closer to becoming a customer or completing a business objective. The specific actions depend on your business model. E-commerce sites track purchases and add-to-cart events. Service businesses track contact form submissions and phone calls. SaaS companies track free trial signups and demo requests.

Define your conversion events before touching any code. Write down every action that generates business value. Rank them by importance. Your primary conversion is the action most directly tied to revenue. Secondary conversions are supporting actions that indicate engagement and purchase intent.

Common WordPress conversion types include form submissions through Contact Form 7, Gravity Forms or WPForms. WooCommerce purchase completions. Newsletter signups through Mailchimp or ConvertKit integrations. Phone number clicks. PDF downloads. Video plays past a certain percentage. Live chat initiations.

Setting Up GA4 on WordPress

Installing GA4 With a Plugin

The fastest method uses Google’s Site Kit plugin. Install and activate Site Kit from the WordPress plugin repository. Connect your Google account and follow the setup wizard to link your GA4 property. Site Kit places the tracking code automatically and gives you a dashboard inside WordPress admin.

For more control use the MonsterInsights plugin or insert the GA4 measurement code manually. To install manually copy your GA4 measurement ID from the Admin section of your Analytics property. Add the gtag.js snippet to your theme’s header.php file or use the wp_head hook in your functions.php file.

If you already have a GA4 setup running verify that the measurement ID matches across all pages. Use the GA4 Realtime report to confirm data flows correctly after installation.

Configuring Enhanced Measurement

GA4 Enhanced Measurement automatically tracks several event types including page views, scrolls, outbound clicks, site search, video engagement and file downloads. Enable it in your GA4 property settings under Data Streams.

Review each Enhanced Measurement toggle and disable any events you do not need. Unnecessary events add noise to your reports. Keep page views and outbound clicks enabled for most WordPress sites. Enable site search tracking if your site has a search function.

Installing Google Tag Manager on WordPress

Why GTM Is the Preferred Method

Google Tag Manager acts as a container for all your tracking codes. Instead of adding individual scripts to your WordPress theme files you place the GTM container code once and manage everything else through the GTM interface. This approach reduces page load impact and eliminates the need to edit theme files for each new tracking requirement.

GTM also supports version control for your tracking setup. Every change creates a new version you can review, publish or revert. If a new tag breaks something you roll back to the previous version in seconds. Follow the Google Tag Manager setup guide for the complete installation process.

Adding the GTM Container to WordPress

Copy the two GTM code snippets from your container’s installation page. The first snippet goes in the head section. The second goes immediately after the opening body tag. Add them to your theme’s header.php file or use a code snippets plugin that supports header and body injection.

// Add GTM head snippet
function qm_add_gtm_head() {
    ?>
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
    <!-- End Google Tag Manager -->
    <?php
}
add_action('wp_head', 'qm_add_gtm_head', 1);
// Add GTM noscript body snippet
function qm_add_gtm_body() {
    ?>
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
    <?php
}
add_action('wp_body_open', 'qm_add_gtm_body');

Replace GTM-XXXXXXX with your actual container ID. Verify the installation using the GTM Preview mode. Navigate your site while Preview mode is active to confirm the container loads on every page.

Creating Conversion Events in GA4 Through GTM

Tracking Form Submissions

Create a new tag in GTM for form submission tracking. Set the tag type to GA4 Event. Enter your measurement ID and set the event name to “form_submission” or a descriptive name that matches your naming convention.

Configure the trigger to fire on form submission. Use the Form Submission trigger type in GTM. Filter by form ID or form class to target specific forms. If your form plugin uses AJAX submissions instead of page redirects you need the Form Submission trigger with the “Check Validation” option enabled.

For redirect-based tracking set up a Page View trigger filtered to your thank-you page URL. This method is more reliable for forms that redirect after submission because it does not depend on detecting the form event in the browser.

Tracking WooCommerce Purchases

WooCommerce purchase tracking requires passing transaction data to the dataLayer. Use a plugin like GTM4WP that automatically pushes WooCommerce e-commerce data into the GTM dataLayer. This includes transaction ID, revenue, product details and other purchase parameters.

In GTM create a GA4 Event tag that fires on the purchase event. Map the e-commerce data layer variables to the GA4 event parameters. Configure the tag to send transaction_id, value, currency and items parameters.

Test the purchase flow using GTM Preview mode and GA4 DebugView simultaneously. Complete a test purchase and verify that all parameters appear correctly in both tools.

Tracking Phone Calls

Track phone call clicks by creating a Click trigger in GTM filtered to elements containing “tel:” in the Click URL variable. Create a GA4 Event tag that fires on this trigger with an event name like “phone_call_click.”

For more granular phone tracking integrate a call tracking platform. These platforms dynamically replace your phone number based on the visitor’s traffic source. They record call duration, caller information and can push conversion data back to GA4 for attribution.

Marking Events as Conversions in GA4

After your events start recording data in GA4 navigate to Admin, then Events. Find the event you want to mark as a conversion and toggle the “Mark as conversion” switch. GA4 will start attributing this event as a conversion in all reports going forward.

GA4 also allows you to create conversions from the Conversions section by adding new conversion events that match your event names. This is useful for pre-configuring conversions before events start recording.

Review your conversion rate optimization strategy regularly to ensure the events you track align with current business priorities. As your site evolves your conversion definitions should evolve too.

Troubleshooting Common WordPress Tracking Issues

Caching Conflicts

WordPress caching plugins can serve stale HTML that does not include your latest tracking code changes. After modifying any tracking code clear your page cache, object cache and CDN cache. Test in an incognito browser window to bypass browser-level caching.

Some caching plugins offer JavaScript deferral or minification that can break tracking scripts. If your tags stop firing after enabling a caching plugin check its optimization settings. Exclude GTM and GA4 scripts from deferral and minification.

Consent Management Interference

Cookie consent plugins block tracking scripts until the visitor provides consent. This is required by GDPR and other privacy regulations but it means your tracking will miss visitors who do not consent. Configure your consent management platform to fire GTM in a limited mode that respects consent while still recording anonymized page views where legally permitted.

Duplicate Tracking Codes

Running GA4 through both a plugin and GTM simultaneously creates duplicate data. Audit your site for duplicate measurement IDs. Use the browser developer tools Network tab to search for your measurement ID. If it appears in multiple requests remove the duplicate installation.

Validating Your Conversion Tracking Setup

Use a multi-step validation process before relying on conversion data for business decisions. First test each conversion event using GTM Preview mode and GA4 DebugView. Second complete the conversion action yourself and verify it appears in GA4 Realtime reports. Third wait 24-48 hours and check the Events and Conversions reports for accurate data.

Create a conversion tracking audit checklist. Run through it monthly to catch configuration drift caused by plugin updates, theme changes or CMS modifications. Document your tracking setup so any team member can troubleshoot issues without reverse-engineering the configuration.

Want experts to configure conversion tracking on your WordPress site? Request a free audit to identify tracking gaps and fix them.

Frequently Asked Questions

Do I need Google Tag Manager for WordPress conversion tracking?

You do not strictly need GTM but it makes tracking management significantly easier. GTM lets you deploy and modify tags without editing WordPress theme files. For sites running multiple tracking pixels and conversion events GTM reduces code conflicts and simplifies maintenance.

Can I track form submissions as conversions in WordPress?

Yes. You can track form submissions by redirecting to a thank-you page and setting that page as a conversion trigger or by using GTM to fire a tag on the form submission event. Most popular form plugins like Gravity Forms and WPForms support both methods.

Why is my conversion tracking not recording data?

Common causes include incorrect tag placement, caching plugins serving stale pages without tracking code, consent management tools blocking scripts before user opt-in and misconfigured event parameters in GA4. Use the GA4 DebugView and GTM Preview mode to diagnose the issue.

How do I track phone calls as conversions in WordPress?

Use a call tracking service like CallRail or WhatConverts that dynamically swaps phone numbers on your site. These services attribute calls to specific traffic sources and can send conversion data to GA4. Alternatively track clicks on tel: links as conversion events using GTM.

Related: marketing strategy guide and web development FAQ

Need help with this?

Quake Media helps businesses across Vancouver and Canada with SEO, PPC and custom web development. Get a free audit and see where your site stands.

★★★★★ 5.0 on Google Reviews

How to Set Up Conversion Tracking in WordPress

Request a free quote

Let us know what you are looking for and we will get right back to you!