Setting up Conversion and Affiliate Tracking
If you are spending a lot of resources on a particular advertising campaign or you've spent time setting up an affiliate marketing program, it's important to implement tracking to find out if they are worth the effort.
Conversion and affiliate tracking is the process of placing a small piece of code in your store to track how your shoppers interact with specific elements or when a purchase is made. This data can be passed to an affiliate or third-party program, such as Google Analytics or Facebook Ads, through the conversion tracking code they provide.
Tracking Code Variables
Affiliate tracking codes contain placeholders to pass order information, such as the order's total and order ID, back to the affiliate tracking program. You will need to replace the placeholders with one of the corresponding tracking variables below. At this time, these are the only variables available for conversion tracking.
- %%ORDER_AMOUNT%% — The order total in dollars/cents.
- %%ORDER_AMOUNT_IN_CENTS%% — The order total in cents.
- %%ORDER_SUBTOTAL%% — The order subtotal in dollars/cents.
- %%ORDER_SUBTOTAL_IN_CENTS%% — The order subtotal in cents.
- %%ORDER_SUBTOTAL_DISCOUNTED%% — The order subtotal in dollars/cents, minus coupons and other discounts.
- %%ORDER_SUBTOTAL_DISCOUNTED_IN_CENTS%% — The order subtotal in cents, minus coupons and other discounts.
- %%ORDER_ID%% — The order ID.
- %%ORDER_EMAIL%% — The customer's e-mail address.
Installing the Tracking Code
To insert a conversion tracking code, go to Advanced Settings › Web Analytics, and check the box next to Affiliate Conversion Tracking.
Save your changes, and click on the Affiliate Conversion Tracking tab that appears at the top of the page. Paste your code into the Conversion Tracking Code box.
If you have multiple conversion codes, you can paste them above or below any existing codes to ensure they don't interfere with each other. Once the code has been pasted, locate the placeholders in your code and replace them with the corresponding variables. You need at least one variable, or you will not be able to save the conversion code.
In the animation above, we added a command to check for an order ID, replaced the static value $0.00 with our dynamic order amount variable (%%ORDER_AMOUNT%%) in two places, and added an order ID parameter to the tracking URL.
How do I remove everything from the Conversion Tracking Code box?
When removing the code, leave a single blank space behind. Then click Save. You will be presented with a warning box. Click OK to finish saving.
What should I do if my tracking code is asking for a confirmation URL?
Some tracking scripts will require you to specify the page a customer lands on after an order has been placed. This URL will differ depending on whether you are using Optimized One-Page Checkout or Legacy Checkout, and if you have a custom domain applied to your store.
If you have a custom domain, your checkout destination URL will look like this:
- Single/multiple page checkout — https://www.yourdomain.com/finishorder.php
- Optimized One-Page Checkout — https://www.yourdomain.com/checkout/order-confirmation
If you are using the mybigcommerce.com domain (not a custom domain), your checkout destination URL will look like this:
- Single/multiple page checkout — https://######.mybigcommerce.com/finishorder.php
- Optimized One-Page Checkout — https://######.mybigcommerce.com/checkout/order-confirmation