Hack on How to Track Shopify Sales in Google Analytics

by | Sep 25, 2018 | Technical

Allowing users to purchase through PayPal skews sales data in Google analytics, all transactions are tracked as PayPal which isn’t ideal as we want to know which channel is performing better. However, there is a simple solution to overcome this problem demonstrated in the 3 easy to follow steps below.

1. LOGIN TO YOUR SHOPIFY DASHBOARD

Login to your Shopify dashboard and click themes under the heading your website on the left side of the screen.  You will then be presented with a new menu – click template editor.

2.  ALTER THE FILE

When you are inside the theme editor, navigate to the product.liquid file on the left hand side of the file menu. Scroll down to line 110 and locate the line of code highlighted in the red box in the screenshot below.

3. REPLACE THE FORM CODE

Replace the highlighted code with the following:

<form action="/cart/add" method="post" id="cart onsubmit="_gaq.push(['_linkByPost', this]);">

Make sure you save the file by clicking save in the top right hand corner for the changes to take effect.  Job done, analytics should now be tracking correctly.

Related reading…