This network request for ‘cart.json’ is intentional and is not blocking the activity of the user or slowing website performance. What our tracking code is doing is checking every 2 seconds for new additions to the customer’s cart.
Many other apps track adds-to-cart by listening for clicks on the “Add to cart” button, and that was our initial approach as well. But we found that wasn’t reliable in the many different themes and combination of other apps that our clients’ websites use.
However your users add an item to a cart in Shopify database, we reliably send those changes as events to Google Analytics. We also store the cart ID (a unique, anonymous number from Shopify) so when the customer buys on Shopify’s system we can link the sale back to the same user in Google Analytics.
Will this slow down the site for my users?
The size of the network request we are making is typically less than 1Kb, and so even if the user is on the site for 10 minutes (a long visit), we have added less than 1Mb of extra data usage – the size of one typical web page.
If you want to adjust the length of this interval, you can apply a custom tracking code to your store, and change the
cartPollInterval on line 4. We recommend no more than 5000 ms (5 seconds), to make sure the add-to-cart event is tracked before the user goes through to checkout.