Cart Tracking Overview

In this article

WooCommerce cart configuration

Metorik offers cart tracking through the Metorik Helper plugin you install on your website during the setup. You need to be running 1.0.0 or higher to use it.

You can then go to the cart settings page in Metorik to enable cart tracking:

If at any time you'd like to disable cart tracking, you can do it from this page as well.

Keep in mind, WooCommerce does not track carts at all, so we can only provide data about them from when you enabled cart tracking in Metorik.

Settings

Once cart tracking has been enabled, you'll be able to change the settings for it.

Move email field to the top of checkout: This setting will try move the email field to the top of the checkout. This can help capture emails before checkout is abandoned, but if you have a custom checkout or have configured the checkout's fields, it may cause problems. Try enable it though and check that everything looks good on your checkout afterwards.

Show email usage notice: Enabling this setting will [attempt to] show an email usage notice under the checkout's email field and under the email field of the 'add to cart email popup'. This explains to customers that you're storing their carts and may email them about them later. It also gives them a way to opt-out of your cart emails and prevent Metorik from storing details about their carts in one-click.

You can easily translate the text shown using any WordPress translation plugin you'd normally use. The text domain is metorik.

Add to cart email popup

When this setting is enabled, we'll try to show a small popup/tooltip whenever an item is added to the cart. In there, we ask for the customer's email, giving us the chance to email them later if they don't checkout.

This popup will only ever shown once and will only show for guests, as we'll already know the email of logged-in customers.

  • If it's an AJAX add to cart button the an archive page, we'll try show it right there.
  • If it's a single product page add to cart button, where the page reloads after an item is added to the cart, we'll try show it after the page reload.
  • If your store takes customers to the cart page after adding an item to their cart, we'll try show it there next to the 'Processed to checkout'. You can disable this one by using this code/filter.

It looks a little bit like this:

By default, it will be placed below the bottom. You can change this and make it on the left for example, by using the metorik_acp_placement filter. So this code for example will place it on the left.

The next setting - Add to cart popup title - lets you change the Save your cart? text to anything else. As soon as the customer's entered a valid email into the email field, we'll link it to their cart.

Of course, you're welcome to customise the template of the popup. To do so, simply add a  add-cart-email-form.php file in your theme under a new metorik folder. So in your theme's folder, you'd create a metorik folder. And then inside of that, you'd create a file named add-cart-email-form.php. You should start by copying the contents of the original template file here. Let us know if you need a hand doing this.

Custom checkout URL

By default we'll send a customer to the checkout page (defined in your WooCommerce settings) after recovering their cart so they can pay. However, you may prefer to send them to the cart or another URL.

In that case, you can use this setting to change the URL they are sent to. Be sure to enter a URL with a forward slash ( /) at the beginning, such as /cart or /shop.

To customise the URL when writing an Engage message, you can append &redirect_url to the {recovery_url} variable and define any redirect URL. For example, inserting a link in an email to {recovery_url}&redirect_url=/ would redirect customers to the home page after recovering their cart. This setting is also useful when sending customers to different pages based on their language, which you can learn more about in this guide.

For more complex rules around how the custom checkout URL is set, you can customise the recovery URL using the metorik_recover_cart_url filter. For example, this code, added to your functions.php or similar, would make it go to the cart:

add_filter('metorik_recover_cart_url', 'mysite_metorik_recover_custom_url');
function mysite_metorik_recover_custom_url() {
    return 'https://mysite.com/cart';
}

Capturing emails from custom inputs

If you have another email input somewhere that guests are putting their email in, you may want to capture/link the email to their Metorik cart.

To do that, all you need to do is add the CSS class metorik-capture-guest-email to the email input.

This can usually be done by editing the code for displaying the input/template (or with some extra JavaScript that adds the class to the input).

Disabling cart tracking programatically

Instead of disabling cart tracking from the Metorik cart settings, you can disable it using a filter:

add_filter('metorik_cart_tracking_enabled', '__return_false');

Shopify cart configuration

There is no need to configure anything in Metorik β€” it will all work from the get-go!


How carts are tracked

Whenever an item is added to a cart, removed from a cart, or any cart-related update happens, your store will send the data to Metorik for storing. No cart data is stored on your site at all, and sending data from your site to Metorik is very quick and has zero impact on your site's performance.

In Metorik, we'll only show you and report on carts that have a valid email attached to them. This means:

1. All carts by logged-in customers.

2. All carts by guests that entered their email through the 'add to cart email popup' or on the checkout page.

We ignore carts without emails as since they don't have any customer information attached to them, we don't want to report on them - this helps keep your data as accurate and reliable as possible. We're considering storing this data in the future, but for now we aren't seeing enough compelling reasons to.

We also ignore carts made by fake/test emails, such as bryce@fakemail.org, so only valid carts come into Metorik.

For more on cart tracking consent + GDPR, please see this help doc.


Cart JS events that trigger cart sending

We hook into a few WooCommerce Cart JS events to determine when to send a cart.

You can change which events we use by adding some code like this your site:

add_filter('metorik_send_cart_events', function() {
    return 'added_to_cart removed_from_cart updated_cart_totals updated_shipping_method applied_coupon removed_coupon updated_checkout';
});
The above code are all the default events that we send carts for.
You can try removing some from the above events if you'd like to stop carts being sent for them. For example, this code stops Metorik sending the cart when the cart totals are updated or when a coupon is removed from the cart. Your use case will likely vary but this should help you get started:
add_filter('metorik_send_cart_events', function() {
    return 'added_to_cart removed_from_cart updated_shipping_method applied_coupon updated_checkout';
});
This code would be added to your site using a 'code snippets' plugin or the functions.php file.

To disable Metorik's cart tracking when cart fragments are updated (eg. if you have a mini cart plugin causing it to refresh when the cart gets tracked), you can use this additional code:

add_filter('metorik_send_cart_fragments', '__return_false');

Cart reports

You can view a variety of cart-related reports and stats from the carts report here. To learn more about cart reports, please see this help doc.

Cart statuses

Carts in Metorik can have one of several statuses...

In Progress: When a new cart is in-progress. Normally it will have this status right after the cart has started, up until an order was placed or the cart was considered abandoned.

Placed: When a cart is started and the order for it is created in the same session (before the cart has been considered abandoned), it will be given the placed status. You'll be able to see the order that was placed for the cart.

Abandoned: When a new cart has not been updated in 30-60 minutes, we'll consider the cart to be abandoned and mark it as such.

Recovered: When an abandoned cart has been recovered through a Metorik cart recovery link, we'll consider the cart to be recovered. More about cart recovery below.


Note: When storing a new order, it looks up any other existing carts with the same customer/order email last updated within the past 7 days and not linked to any order and then deletes them. This is to prevent people who recently ordered from receiving abandoned cart emails.


Recovering carts

Using  Metorik Engage, you can automatically send cart recovery emails to abandoned carts. To learn more about sending cart recovery emails with Engage, please see this help doc.

Still need help? Contact Us Contact Us