Skip to main content

BigCommerce Conversion Tracking

Step 1: Add the global site tag

Before you can start sending conversion events, you need to place the following global site tag snippet in the <head> section of every web page where you want to track events.

<script async src="https://a.ads.rmbl.ws/ratag?id=AV-XXXX"></script>
<script>
window._ratagData = window._ratagData || [];
function ratag() {_ratagData.push(arguments);}
</script>

Step 2: Determine the page for the script

Place the dynamic conversion tracking script on the page where the cart's total value is available; this is typically on the order confirmation page. Placing the script on the correct page ensures you are capturing the value at the point of conversion.

Step 3: Access the cart's total value

If you're using BigCommerce's Stencil framework, you can use Stencil's global objects to access the order total. The object {{order.total_inc_tax}} retrieves the total value of the order including taxes. If taxes are not relevant, you may use {{order.subtotal_ex_tax}} to get the subtotal excluding taxes.

  • Total Value (with tax): {{order.total_inc_tax}}
  • Subtotal Value (without tax): {{order.subtotal_ex_tax}}

Step 4: Insert the dynamic value into your conversion script

Now that you know which value to use (either total_inc_tax or subtotal_ex_tax), you’ll modify the ad conversion script to dynamically populate the price of the cart.

Example for total value including tax:

<script>
ratag('conversion', {
to: XXXX, // Replace XXXX with your actual tracking ID or value
value: {{order.total_inc_tax}} // Dynamically pulls the total order value including tax
});
</script>

Example for subtotal value excluding tax:

<script>
ratag('conversion', {
to: XXXX, // Replace XXXX with your actual tracking ID or value
value: {{order.subtotal_ex_tax}} // Use this if taxes are irrelevant or you want to track the subtotal
});
</script>

Step 5: Place the script on the order confirmation page

Ensure the script is placed on the order confirmation page of your BigCommerce store. This page appears after a successful purchase, where the order's total value is finalized and can be tracked.

Step 6: Test the implementation

After implementing the script, thoroughly test it by completing a purchase. Make sure:

  • The total or subtotal value is correctly captured.
  • The value is passed to your ad conversion tracking.
  • The conversion tracking platform (e.g., Google Ads, Facebook Ads) is receiving accurate data.

Step 7: Adjust the setup if needed

If you are not using Stencil or run into issues, consult the BigCommerce documentation or contact BigCommerce support to tailor the solution to your specific setup.