Custom Tracking Scripts in Bold Cashier

With Bold Cashier, you can use custom tracking scripts to customize the information that gets sent to Google Analytics and Facebook Pixel.

You can also integrate with other analytics and tracking services that aren't directly integrated with Cashier to track successful purchases. Please visit Integration Hub for Bold Cashier for more information on how to link your tracking accounts to Cashier.

If you need  help creating a script to add to Bold Cashier, you can reach out to Shopify Experts through StoreTasker.

 Caution

This article is specific to Bold Cashier on Shopify. If your store is using Bold Checkout, please visit the articles relevant for BigCommerce, WooCommerce, or commercetools, here.

 


 

Setup

 Alert

This article requires significant knowledge of JavaScript. If you are not comfortable with JavaScript, we strongly suggest contacting your developer before proceeding.

While in the Bold Cashier app, navigate to Settings > Analytics. 

When in the Analytics setting, scroll down to Custom Script and enable to toggle beside Enable custom script. After this has been enabled, enter in your custom script(s) and then select Save

 


 

Limitations

  • Custom scripts cannot include <script> tags. This includes script tags that call external JavaScript.
  • Liquid code cannot be used for variables as the correct values will not be populated. You will need to use Bold variables.
  • There are certain types of scripts that won't work in the custom scripts section of Bold Cashier:
    • Scripts that add anything to the checkout like images, popups, a link, or input fields.
    • Any service that does heat-mapping to track how your customer interacts with the checkout.
    • Anything that requires Google Tag Manager.
    • Anything that requires code being added in the <head> of the checkout.
  • Custom tracking scripts can only run on the Thank You Page to track successful purchases.
 Pro-Tip

Cashier has an integration with Google Tag Manager to allow you more control over your analytics.

 


 

Variables

These are some of the order parameters you can use to create your custom scripts:

  • BOLD.order.id: The ID number of the customer's order, in Cashier.
  • BOLD.order.currency: The currency the order was purchased in.
  • BOLD.order.customer.email: The customer's email address.
  • BOLD.order.billing_address.province_code: The province or state ID code (Manitoba = MB).
  • BOLD.order.billing_address.country_code: The customer's country ID code (Canada = CA).
  • BOLD.order.line_items.sku: The item's SKU number.
  • BOLD.order.line_items.title: The product title (product name).
  • BOLD.order.line_items.price: The price of the item in the lowest denomination ($39.95 = 3995).
  • BOLD.order.line_items.quantity: The quantity of a purchased product.
  • BOLD.order.line_items.platform_variant_id: The item's Shopify variant ID.
  • BOLD.order.line_items.platform_product_id: The item's Shopify product ID.
  • BOLD.order.subtotal: The order's subtotal in the lowest denomination ($39.95 = 3995).
  • BOLD.order.total_shipping: The total cost of shipping.
  • BOLD.order.total_tax: The total amount of taxes on the order.
  • BOLD.order.total: The complete order total cost (including tax and shipping).

Please visit Analytics Documentation for more information about what's available in the order object. 

 


 

Troubleshooting

When it comes to loading in an external script, it is usually done by using script tags.

 Example
<script src="https://www.domain.com/script.js"></script>

Cashier doesn't allow you to add script tags into the custom tracking scripts, however. You can use the following code to load an external script.

var script = document.createElement("script");  // create a script DOM node
script.src = url; // set its src to the provided URL

document.head.appendChild(script); // add it to the end of the head section of the page (could change 'head' to 'body' to add it to the end of the body section instead)
Was this article helpful?
0 out of 0 found this helpful