Scalable and Reliable Conversion Event Tracking in WooCommerce

Scalable and Reliable Conversion Event Tracking in WooCommerce

To run a successful eCommerce business you need to track checkouts also called conversions. You'll want to use data to connect those conversions to specific marketing channels and allocate your marketing resources appropriately.

WooCommerce of course offers built-in conversion tracking and offers several reports via WooCommerce Analytics.

Some of the top-line numbers in WooCommerce Analytics

And for a nascent eCommerce business these stats can work but as you grow you'll want to send conversion events to other tracking services.

  • Website event tracking (Google Analytics, Heap, etc.)
  • Email marketing software (Klaviyo, MailChimp, etc.)
  • Help desk software
  • Affiliate software
  • Ad tech (Facebook Ads, Google Ads, etc.)

Some of these have great integrations with WooCommerce (shoutout to Metorik!) and if you use services which have great integrations you can install those integrations and call it done. But there are thousands of applications and many don't integrate with WordPress or WooCommerce.

When that happens you'll have to write your own integration and then you'll need to think about when you send a conversion event, and how to do so in a way that doesn't slow down your website.

When to Send a Conversion Event

If you haven't worked with WooCommerce before you might be surprised to know there's no definitive time when you should send a conversion event. There are order statuses such as:

  • On-hold
  • Pending
  • Processing
  • Completed

But, there's no enforced consistency. Order statuses are effectively controlled by your payment gateway.

At Xero Shoes we have several payment gateways all of which use different order statuses.

  • PayPal & Klarna put orders in Pending
  • Braintree puts orders into Processing
  • If someone places an order via check orders are placed into On-hold
  • And we don't mark orders as Complete until they've left the warehouse which takes between 1-3 days. Enough of a delay to totally mess up conversion tracking.

So if you write any custom functionality for your store to track conversions which order status do you use? Well if you only use one payment gateway and it consistently uses one order status you can use that. Many credit card processors use the Processing order status.

But if you don't want to write fragile code that may require updates in the future you should use a different hook.

At Xero Shoes we use the ThankYou page to send conversion events. And we use this page for two main reasons:

  1. It loads immediately after a customer places an order on the front-end of the site. It by-passes needing to know anything about order statuses.
  2. This hook let's you easily add client-side tracking events. This means that your Google Analytics, your Facebook tracking pixel, and your Klaviyo conversion event will all load invisibly to the user and send data from their browser to the tracking service.

But there is of course a problem with using the Thank You page for all conversion events. If you're sending backend API requests to tracking services that can slow down the Thank You page being sent to the customer. If the API is slow or entirely down yours customers might think they didn't checkout and generate customer service requests and duplicate orders. Not good.

To solve these problems we need to look into the Action Scheduler.

How to Send a Conversion Event – Action Scheduler

Action Scheduler is built into WooCommerce. It's also a stand alone plugin that can be included in your WordPress site even if you aren't using WooCommerce

Action Scheduler let's you … schedule actions. How apt-ly named. 😃

Think of it as a programmatic post-it that says “remember to buy milk on Thursday”. On Thursday your website will go out and buy milk.

What's so useful about Action Scheduler on the Thank You page is that you can schedule an action to fire a conversion event a minute after the order is placed.

That means that the customer will load the Thank You page quickly and your store still sends conversion events in near real-time.

Here's how this looks in practice:

<?php
/
* Example Sending Conversion Event via Action Scheduler
*/
if ( ! function_exists( 'update_event_tracking_software' ) ) {
/
* Handle order status changes and send events to event tracking software PAP updates.
*/
function update_event_tracking_software( $order_id, $old_status, $new_status ) {
// Schedule an API request to Event Trackig Software in the background
as_schedule_single_action( time(), 'event_tracking_change_order_status', array( $order_id, $status ) );
return;
}
}
add_action( 'woocommerce_order_status_changed', 'update_event_tracking_software', 10, 3 );
// Add actions for the Action Scheduler to run our asynchronous callback function (below)
add_action( 'event_tracking_change_order_status', 'event_tracking_change_order_status_callback', 10, 2 );
if ( ! function_exists( 'event_tracking_change_order_status_callback' ) ) {
/**
* Send conversion event to Event Tracking software
*/
function event_tracking_change_order_status_callback( $order_id, $status ) {
// Continue writing your code here.
// Action Scheduler will run this code in the background
// Send an API request.
// @see https://developer.wordpress.org/reference/functions/wp_remote_post/
}
}
?>
view raw functions.php hosted with ❤ by GitHub

We recently updated one of our API-requests from sending the event on the Thank You page to sending that same event through the Action Scheduler and the Thank You page loads a whopping 8 seconds earlier! 🤯

That's good for our customers and it also makes our website more reliable and stable since we aren't relying on an API being online at all times.

If you are still manually sending back-end API requests on the Thank You page or using one of the hooks above you should send your events asynchronously and improve your website reliability & stability.

How to Make the WooCommerce Sale Price Accessible

How to Make WooCommerce Sale Price Accessible

I recently joined Xero Shoes. They're one of the largest WooCommerce stores in the world. And as luck would have it we received the results of an accessibility (a11y) audit right after I started. That meant my first project is to dive deep into accessibility with WordPress & WooCommerce.

And the first item I looked into was making sure our sale prices were accessible. 👇

Continue Reading…

Seek Opportunities to Cut Your To-do List

Seek Opportunities to Cut Your To-Do List

We live in a world where there's always incentive to do more.

  • Write more blog posts for organic SEO
  • Tweet daily
  • Create Tiktoks to promote your products
  • Write unique content for your premium email list

And after a while it just adds up and you're paralyzed with an unending to-do list. I've found that the more on my todo list the less I actually get done. The more I can focus my attention with a clear priority for the day the more productive I am.

Recently I've been looking for ways to cut down my to-do list. Not by evaluating each individual task, that takes a ton of time, but by preventing tasks from getting on my list in the first place. I want to create rules so I know where I should spend my time.

Continue Reading…

Top Down SEO Research

Top Down SEO Research

 Hello internet friends. Today I want to share some of the awesome SEO work that I've been doing at eCommerceFuel. 🤓

If you're familiar with SEO research, a lot of writers come up with a list of topics they want to write about and then they will search for keywords related to that topic. They'll find a keyword somewhat related to their topic, they'll write about it, and hope that it ranks. 🤞 I call this bottom-up SEO research.

Then there's what I'm calling top-down research. And the hard part is you start the process ignoring what we want to speak about at first, doing all of the SEO keyword research, grouping everything, looking at the volumes (number of searches), and then from that list deciding which keywords we want to write about.

The benefit to doing keyword research this way is you know if you rank well you'll see decent traffic. And it prevents common problems like keyword cannibalization which can happen when you don't make an SEO plan.

Let me show you how I follow this process and how it drives traffic for eCommerceFuel:

Continue Reading…

Content Is Never Going to Zero

Content will Never Cost Zero Dollars

Ever since Chat GPT came out at the end of 2022 I’ve seen predictions about content. Some good and some bad. But the general idea is that ‘the cost of content is going to $0”. This is hot-take based on the hype-cycle around a new technology. This prediction doesn’t follow any historical cases, and it assumes that creating content is primarily writing – which it isn’t.

There are some highly relevant historical examples, creating content is more than just writing, and there are fundamental flaws in Chat GPT that humans need to compensate.

Continue Reading…

From Ideas to Execution: Crafting a Bespoke Content Creation Process

Content Creation Process

I recently developed a content creation process for eCommerceFuel. In my first three months, I built a process that satisfies two primary responsibilities:

  1. Synthesize the most useful content for our existing members from the internal eCommerceFuel Forum
  2. Publish blog content that will attract 7- and 8-figure eCommerce businesses and encourage them to join the forum

There are a surplus of moving pieces involved in research, strategy, and content production, so I devised a process to help me juggle multiple projects at the same time — without compromising quality.

That's because our target persona (7- and 8-figure business owners) demands very high quality content. If we expect to continue attracting the best and brightest to our community we have to hold our site up to a high standard. And, to ensure it remains consistently relevant, we still need to publish at least once a week.

Here, I'll share how we've created eCommerceFuel's new content creation process from scratch.

Continue Reading…

Re-Engagement Campaign Magic: How We Improved Our Email Open Rate by 25%

Re-engagement Campaign

This article originally appeared on eCommerceFuel.

If you’ve been in the eCommerce industry for a while you’ve probably heard that email marketing is one of the most cost-effective marketing channels out there. Some stats say that email marketing has a 36X return-on-investment (ROI).

But despite this many eCommerce entrepreneurs neglect their email list and they tend to go cold where your readers forget who you are and what you email them about.

When you have a cold email list, few readers open your emails. Email service providers like Google notice this and eventually funnel more and more emails into spam. This robs your readers the choice to even read your email. That defeats the purpose of the channel.

Today we’re going to explore how you can run a re engagement campaign for your email list. ✉️

Rather than just talk about how to do this theoretically we’re going to share actual numbers as we warm up the email list for eCommerceFuel.

Counterintuitively, by deleting users who will never open our emails deliverability for the whole list will go up and your open rate should increase. (hint: it did for us!) 📈

Continue Reading…

Highlights From ECF Live 2023

ECF Live 2023 banner

This article originally appeared on eCommerceFuel.

I’d never experienced anything like it. I was standing inside a real aircraft carrier surrounded by fighter jets while Maverick himself, THE Top Gun, took photos with smiling eCommerce entrepreneurs. With that perfect swagger and smirk I could have sworn Tom Cruise must have taken a break from filming Mission Impossible 8 to schmooze at the Opening Party for eCommerceFuel Live.

Tom Cruise Impersonator at ECF Live Opening Party

Last week over 300 eCommerce Fuel members gathered in San Diego for eCommerceFuel Live. With an exclusive guest limited to business owners who bring in more than seven figures, this is the top event of the year for many of the eCommerce entrepreneurs who attend.

If you’ve spent any time in the eCommerce space, then you know there’s a veritable glut of networking and informational events for online entrepreneurs. But only eCommerceFuel Live gives its guests the opportunity to mingle with the cream of the crop. By making this a private event for the most successful business owners in our already-vetted community, we guarantee each person in the hall is a peer with top tier knowledge and experience in their field.

Continue Reading…