- Subscription acquisition (Subscription D2C)
If you are selling your product as a subscription it’s important to understand (a) which marketing activities acquire customers and (b) which marketing activities bring the whales (customers with a high customer lifetime value). - New customer acquisition
Understanding how marketing impacts new customer acquisition helps you to understand where to spend less on advertising on existing customers. - Net margin
If you run an E-commerce store with 100s or 1000s of SKUs understanding net margin impact helps you to optimize your campaigns towards higher net margin contribution. - Net revenue
Depending on your industry or product it can happen that you have issues with returns. In this case a net revenue model will help you to understand which campaigns have high cancellations and spend less on them.
Shopify and Google Analytics
Step 1: Connecting your data

Step 2: Exporting the data
Shopify
Shopify orders

Shopify customers

Step 3: Joining the data
GA Transaction ID = Shopify Order Name
Analysing customer journeys
Net revenue journeys
Let’s start with the basics: The acquisition journeys. As a first exercise we’re joining the journeys from the conversions table (source, medium, campaign dimensions from Google Analytics) with the Shopify Net revenue.

SELECT
transaction_id,
TO_DATE(custom_crm_shopify_orders.date, 'YYYY-MM-DD')::date as date,
order_email,
net_revenue,
sourcepath,
mediumpath,
campaignpath,
dayslag
FROM
conversions,
crm_conversions,
custom_crm_shopify_orders
WHERE
crm_conversions.transaction_id = conversions.transactionid
AND transaction_id = order_name
ORDER BY custom_crm_shopify_orders.date DESC;
Journeys with CLV

SELECT
DISTINCT ON (customers.customer_email)
orders.date::date AS order_date,
SUM(orders.order_net_sales::REAL) AS clv_revenue,
customers.customer_email,
conversions.sourcepath,
conversions.mediumpath,
conversions.campaignpath
FROM custom_crm_shopify_customers AS customers
LEFT JOIN custom_crm_shopify_orders AS orders ON orders.order_email = customers.customer_email
LEFT JOIN conversions ON orders.order_name = conversions.transactionid
WHERE conversions.sourcepath IS NOT NULL
GROUP BY 1,3,4,5,6
ORDER BY customer_email,order_date ASC;
Shopify CLV attribution and Shopify CAC attribution
BEGIN;
TRUNCATE TABLE crm_conversions;
INSERT INTO crm_conversions(datasource,net_revenue,transaction_id,crm_type)
WITH crm_data as (
SELECT DISTINCT on (customers.customer_email)
'Shopify Customers' as datasource,
min(orders.date::date) as order_date,
customers.customer_email,
SUM(orders.order_net_sales::REAL) AS net_revenue,
orders.order_name as transaction_id,
'Shopify - CLV revenue' AS crm_type
FROM custom_crm_shopify_customers AS customers
LEFT JOIN custom_crm_shopify_orders AS orders ON orders.order_email = customers.customer_email
LEFT JOIN conversions ON orders.order_name = conversions.transactionid
WHERE customers.customer_orders_count::REAL > 0 and orders.date::date IS NOT NULL
GROUP BY 1,3,5,6)
SELECT datasource,net_revenue,transaction_id,crm_type from crm_data
;
INSERT INTO crm_conversions(datasource,net_revenue,transaction_id,crm_type)
SELECT
'Shopify Orders' AS datasource,
sum(order_net_sales::REAL) AS net_revenue,
order_name as transaction_id,
'Shopify - Net Revenue' AS crm_type
FROM custom_crm_shopify_orders
GROUP BY 1,3,4
;
COMMIT;
- Each transaction recorded in Shopify with the net revenue
- Each customer and her/his first transaction and the customer lifetime value (calculated as sum of the net sales of all transactions belonging to this customer)

Wrapping it up/TLDR
Further reading
Free E-Commerce Dashboard Templates
Connect Shopify to Google Sheets
Shopify Google Data Studio Connector
How to connect Google Analytics to your CRM system?
What is Marketing Attribution and how does it work?
Addressing Shopify attribution problems for subscription products
Windsor vs Coupler.io

