Custom Conversion Tracking in WooCommerce

If you integrate any third-party services with your WooCommerce site (for ads, analytics, marketing, drop shipping, or A/B testing), it’s often helpful or necessary to provide conversion data through javascript.

A lot of the big services, like Google Analytics (tutorial) or Facebook ads, have off-the-shelf extensions you can use. But for smaller services, you often have to write some custom code to send them the conversion information.

Generally the easiest way to do this is by using the woocommerce_thankyou hook. This action is only fired on the order confirmation page and also provides the $order_id variable, which gives access to all the order details. Continue reading

Tracking eCommerce in WordPress

If you run any type of eCommerce site, it’s important to understand how visitors found your site and which specific entry pages led to a conversion. Tracking data can also let you know the type of content or marketing that is worth investing in.

Here’s a screenshot from a basic eCommerce dashboard I have set up in Google Analytics for a client with a WooCommerce shop (some data changed to make anonymous):

woocommerce-dashboard

Seeing the top referrers, landing pages, and revenue at a glance is great. But once the eCommerce data is in Google Analytics, you also drill down and answer very specific questions.

For instance, is an ad campaign on one site performing better than another? Should ad traffic be sent to the home page or the shop page? What is the conversion rate (or total revenue numbers) for visitors from Google who landed on an article page via an organic search? Continue reading