Why do Shopify and Google Analytics Need to Be Connected?
Shopify is the largest platform for e-commerce stores. Google Analytics is one of the most widely used web analytics services. Both offer a rich set of marketing data, but there are often significant discrepancies between them.
Many marketers see this as a natural technology limitation. It doesn't have to be this way. E-commerce sales can be tracked throughout the entire funnel: from the first interaction to the revenue. Attributing sales to leads and leads to marketing sources allows for accurate tracking of end-to-end marketing campaigns and understanding of ROI. The server-side Shopify and Google Analytics integration in combination with first-party attribution makes it possible to get a complete view of the customer journey.
A Complete Solution for Integrating Shopify and Google Analytics
Method 1. Built-in Shopify's Google Analytics tracker
Both platforms use tracking cookies and are unable to use customer tracking data to attribute all subsequent revenue to the source. Sending data from Shopify to Google Analytics without first-party attribution does not provide a complete view of the customer journey and understanding of which marketing activities led to sales, and does not solve the problem of missing transactions or data discrepancies.
Method 2. Via Google Tag Manager
It is very time-consuming to set up and may require an experienced developer. However, some customer events still happen offline independently of a page view and therefore are impossible to track with GTM. Only a server-side Google Analytics integration allows them to be sent to Google Analytics.
Method 3: Using Able CDP
Able Customer Data Platform is the ultimate Shopify and Google Analytics integration.
It combines browser tracking with server API integrations, linking website activity with purchases on the back-end to build a complete journey of each customer across Stripe and Google Analytics.
This allows to attribute 99% of sales to the correct marketing source, ad click and landing page and obtain data to inform strategy.
All of this without coding and complex manual set-up of the connection between Stripe and Google Analytics. Able already knows how to connect marketing data between Shopify and Google Analytics.
How Able CDP Integrates Shopify and Google Analytics
Able CDP Shopify purchase tracking attributes Shopify purchases to original customer sources, allowing Able to attribute them correctly.
Able Customer Data Platform combines browser and back-end tracking to:
5 Steps to Connect Shopify with Google Analytics by Using Able
Complete the sign up form to get instant access to your Able trial account for free.
After signing up for a free account, Able CDP will prompt you to add code to your website. The tracking code is necessary to allow Able to link further Stripe conversions with the original visitor and TikTok click Id.
Add lead form URLs to the HTML Forms Tracking section to let Able automatically recognize the sign-up and lead forms you're using. Any standard lead form widgets that we could detect during the account setup will appear in the Dynamic Lead Forms Tracking section.
Press "Generate" in the Get Code section to generate a unique tracking code to add to your site.
Able CDP page view tracking doesn't install its own cookies and relies on third-party identifiers such as Google Analytics Client Id to connect customer activity between website pages. Please enable cross-domain measurement in Google Analytics if your landing and lead/order pages are hosted on different domains.
Attribute Shopify purchases to original customer sources to report marketing sources of all purchases, as well as to understand individual customer journeys.
1. Add the following code to the Settings — Checkout — Additional scripts in Shopify:
<script>
(function() {
var el = document.createElement('script');
el.src = 'https://app.formsable.com/ue.js';
el.async = 'true';
el.addEventListener('load', function() {
uipe('init', "%%FUNNEL_MARK%%")
uipe('track', 'Purchase', {
deal_value: '{{ total_price | money_without_currency }}',
deal_currency: "{{ currency }}",
deal_items: [ {% for line_item in line_items %}
{
sku: "{{ line_item.sku }}",
qty: {{ line_item.quantity }},
price: '{{ line_item.line_price | money_without_currency }}',
},
{% endfor %} ],
order_id: {{ order_number }},
keys: {
email: "{{ checkout.email }}",
phone: "{{ checkout.customer.phone }}",
client_id: "shopify:{{ checkout.customer.id }}",
},
lead: {
firstName: "{{ checkout.billing_address.first_name }}",
lastName: "{{ checkout.billing_address.last_name }}",
city: "{{ checkout.billing_address.city }}",
country: "{{ checkout.billing_address.country_code }}",
state: "{{ checkout.billing_address.province_code }}",
zip: "{{ checkout.billing_address.zip }}",
},
})
})
document.head.appendChild(el);
})();
</script>
(Where %%FUNNEL_MARK%% is the unique funnel identifier.)
2. It's strongly recommended to add Able CDP visitor tracking code to the rest of the website pages as well. It records Facebook and Google click ids when a visitor first comes to the website, and uses Google Analytics Client Id in addition ad platform browser ids to better track customers. (Google Analytics must be installed for this tracking script to work correctly.)
This code can be added to Shopify store by editing the theme.liquid template or using GTM.
Visitor tracking code example below supports tracking standard Shopify Lead and Contact forms. It needs to be extended if you're using additional lead generating plugins or landing pages.
<script>
(function() {
var el = document.createElement('script');
el.src = 'https://app.formsable.com/ue.js';
el.async = 'true';
el.addEventListener('load', function() {
uipe('init', "%%FUNNEL_MARK%%");
uipe('track', 'PageView');
(function() {
var leadForm = document.getElementById('contact_form');
if (leadForm) {
leadForm.addEventListener('submit', function () {
var leadParams = {
keys: {
email: leadForm.elements['contact[email]'] && leadForm.elements['contact[email]'].value, phone: leadForm.elements['contact[phone]'] && leadForm.elements['contact[phone]'].value
}, lead: {
}
};
uipe('track', 'Lead', leadParams);
});
}
})();
});
document.head.appendChild(el);
})();
</script>
3. After Shopify purchases begin to appear in Able CDP under Customers — Purchases tab, set up one or a few of the supported outbound Purchase conversion integrations listed below. If you're currently sending Purchase events to the same service using another integration or tracking code, it's recommended to disable sending Purchase conversions with it and only send Purchase conversions using Able CDP Conversions API integration to prevent duplicates.
1. The first step is to locate the Google Analytics tracking id for the property you’d like to use for reporting.
Open Google Analytics, Admin – Property Settings page. Tracking Id should be the first item on the list. Record it.
2. Second, you'll be prompted to save a Google Analytics Tracking ID in Able
3. Enable Outbound Integration
Select the Google Analytics Credential you’ve just saved and ‘Lead’ event type. Press ‘Save’.
Enabled for the following event types:
Following the above process for sending leads, you will be prompted to set up the purchase integration to send attributed Purchases to Google Analytics from any source, such as a sending a closed won CRM deal, a successful Stripe Invoice payment or an e-commerce purchase that has been successfully paid.
The first step is to check Google Analytics reporting settings and investigate that the property is set up correctly to display e-commerce conversions.
On Google Analytics, Admin – Ecommerce Settings. Enable Ecommerce should be on, Enhanced Ecommerce – off.
There’s also a setting that configures for how long GA attributes purchases to the user after the conversion sources. It is located under Admin – Tracking Info – Session Settings – Campaign timeout.
To connect Google Analytics with Able, locate the Google Analytics tracking id for the property you’d like to use for reporting.
In Google Analytics Admin – Property Settings page. Tracking Id should be the first item on the list. Record it.
2. Save Google Analytics Tracking ID to Able
3. Enable Outbound Integration
Select the Google Analytics Credential you’ve just saved and ‘Purchase’ event type. Press ‘Save’.
At this point required integration setup is complete and Able will start sending all Purchases that it attributed to Google Analytics visitors to Google Analytics Measurement API. Conversions will appear in all standard reports; additionally, Purchases will appear in the Conversions tab of E-commerce reports.
Learn More
E-Commerce Conversion Funnel Tracking
Able CDP helps to track modern multiple step e-commerce funnels where customers interact with multiple services prior to eventually making a purchase, resolving issues with incorrect Google Analytics attribution and conversions missing from Google Ads and Facebook Ads reports.
Send Purchases to Google Analytics
Send attributed Purchases to Google Analytics from any source, such as a sending a closed won CRM deal, a successful Stripe Invoice payment or an e-commerce purchase that has been successfully paid.
Sending conversions to Google Ads is an extremely common integration scenario. Its used to add conversion value to Google Ads’ reports, allowing to report on ROI, as well as to use performance-based targeting and optimization capabilities.
Send Purchases to Facebook Conversions API
Attributing conversions to Facebook Ads is a common task, however doing it with sufficient precision is hard. Sales might happen in CRM, or, when they happen online, customer might not come back to the website, so tracking with Facebook Pixel JS produces substandard results. Able solves this problem with its Facebook Conversions API integration.
“A valuable insight we've got because of using Able Customer Data Platform is that display ads aren't working for us at all... we've been wasting money for years on paid display ads.
Before Able we'd be excited about every lead or email that came through, but after the last year we've determined that those don't convert at all.
And so we've been focusing on paid search, which does have return on investment.”
— Bryan Brinton, Co-Founder, Aluvii Software
📈
Continuously improve marketing strategy with actionable data produced by Able tracking.