Tracking Rebuy's Smart Cart in Google Analytics
One of Rebuy's most popular products is the Smart Cart, which adds upsell and promotional potential to Shopify.
If your store uses the Smart Cart here's a simple way to track who is interacting with the cart and, in conjunction with Littledata's Google Analytics tracking for Shopify, how this leads to purchasing.
Tracking Rebuy Smart Cart
Using the integration below you can move beyond Rebuy's own analytics to track interactions with the Smart Cart.
In Google Analytics you can use the events tracked to:
See how many users open the Smart Cart
See if users who switch to subscription go on to checkout that subsciption product
See if users who selected an upsell in the Smart Cart have a higher Average Order Value
See how many products sold came from quantity increases in the Smart Cart
Events tracked
After added the script below to your store, you will see these useful events to Google Analytics:
rebuy_smartcart_shown
Smart Cart is shown / opened
rebuy_smartcart_hidden
Smart Cart is hidden / closed
rebuy_smartcart_item_increase
An item quantity has been increased
rebuy_smartcart_item_decrease
An item quantity has been decreased
rebuy_smartcart_item_removed
A customer removes an item from the Smart Cart
rebuy_smartcart_switched_to_subscription
An item is switched to subscription
rebuy_smartcart_switched_to_onetime
An item is switched to one-time
Adds to Cart and Remove from Cart that happen outside of the Smart Cart are already tracked by Littledata tracking for Shopify.
You'll be able to see those events using a Google Analytics debugger on the browser:

Using the events in Google Analytics
You'll be able to see chat events in the realtime reports for testing, and under Reports > Engagement > Events within 24 hours.
If you want to see how many people who viewed the Smart Cart went on to purchase you can build a customer segment of those that have a rebuy_smartcart_shown event and compare with those users which did not.
Or look at the volume of events received and whether a certain volume of messaging drives purchasing.
Adding the script
You'll need developer access to the Shopify theme to add this integration currently. Please get in touch if you need help implementing this.
You need to paste this script anywhere into the Shopify theme.liquid file, or assets loaded from the theme. It listens for the Smart Cart events, and passes those events onto Google Analytics using the gtag library.
If the gtag library has not yet loaded the events will be queued until Google Analytics is ready.
Last updated
Was this helpful?