Shopify
Install the nextanalytica app in Shopify, so your agent sees each order with the visit, channel and campaign it came from.
Updated
What we read
- Paid orders of the last 30 days, then every hour: number, total after refunds, currency
- The channel, campaign and landing page Shopify recorded for the buyer's visit; never the buyer's name, email or address
How it connects
Open Connections > Shopify in your project, fill in Shop domain and Client ID, paste your Client secret, and click Connect.
We check the Client secret with the vendor at once. It is kept encrypted for this project, never shown again, and deleted when you disconnect.
How do you connect Shopify?
With the nextanalytica app: no code, no keys.
- Install the nextanalytica app on your shop. Ask us for your shop's install link while the app waits for the Shopify App Store.
- In Shopify admin, open Apps > nextanalytica and click Connect nextanalytica.
- Sign in to nextanalytica if asked, then choose the project for your shop, or make one. You come back to Shopify, linked.
- Click Turn on the nextanalytica app embed in your theme, and in the theme editor turn nextanalytica on and click Save. That adds the tag to every page.
The app then:
- Adds the tag to every page of your shop, so nextanalytica counts its visits.
- Watches the checkout with a Shopify pixel: each step and each purchase, tied to the visit it came from.
- Copies your paid orders every hour, each with the visit it happened in, even when an ad blocker stopped scripts at checkout.
To stop, open the app in Shopify admin and click Unlink, or uninstall it.
What do we keep about a buyer?
- The visit each order happened in, and after the buyer agrees to tracking, their device. Where Shopify asks for no consent banner, its setting allows it. See Cookieless counting and consent.
- Their Shopify customer id, so their orders on a phone and a laptop count as one person.
- A hash of their email, never the email itself. No name, phone or address.
When Shopify asks us to erase a customer or a shop, we delete what we keep, and a later sync doesn't bring it back.
Without the app
If you'd rather not install the app, connect the shop with your own app's key instead. The orders still come every hour, but without the checkout pixel.
Requirements
- A Shopify shop, and the Shopify account that owns it. The app and the shop must be in the same Shopify organization.
- Your own app in Shopify's Dev Dashboard, with the
read_ordersandread_customersscopes and Custom distribution. It takes about 2 minutes; your agent can walk you through it. - The shop's
myshopify.comaddress, such asyourshop.myshopify.com. Find it in Shopify admin under Settings > Domains.
How do you create the app?
- Open Shopify's Dev Dashboard with the account that owns the shop, then go to Apps > Create app.
- Name it
nextanalytica, turn off Embed app in Shopify admin, enterread_orders,read_customersunder Scopes, and click Create app. Then click Release. - Open the app's Distribution, choose Custom, enter the shop's
myshopify.comaddress and click Generate link. Open the link and click Install. - Open the app's Settings and copy the Client ID and the Client secret.
Your agent can credit each order to the ads before it and give ROAS by ad account and campaign: see Attribution models.
Which orders count?
We sync every hour: the orders that changed since the last sync, and every order of the last 3 days again, since Shopify adds where the buyer came from a while after the order.
| Order | Counts as |
|---|---|
| Paid | Revenue, in its currency |
| Partly refunded | Revenue, what's left after the refund |
| Refunded | 0 |
| Cancelled | Not revenue |
| Unpaid, authorized or pending | Not counted until it's paid |
| A test order | Not counted |
Orders from every sales channel count toward revenue, so the total matches Shopify's. Only online-store orders get a channel; orders from your point of sale, drafts and subscriptions have none.
Where does the channel come from?
From Shopify. For each online-store order, Shopify records the buyer's last visit: the page they landed on, the site that sent them and its UTM tags. We name its channel the way the tag names a visit's, such as Email or Paid search, and keep the campaign and landing page.
Your agent can then answer revenue by channel, campaign and landing page. It's Shopify's record of the visit. To tie each order to the visit nextanalytica counted, add the Shopify line below.
How do you tie each order to its visit?
Add both lines to your theme, in Online Store > Themes > Edit code > theme.liquid, before </head>:
<script async src="https://t.nextanalytica.app/t.js" data-project="na_…" data-shopify-customer="{{ customer.id }}"></script>
<script async src="https://t.nextanalytica.app/s.js"></script>The second line puts the visit on the buyer's cart, and Shopify carries it over to the order. The next sync then ties the order to the visit it happened in, even when an ad blocker stops scripts at checkout. Your agent can count how much revenue is tied to a visit (the visit dimension).
- Consent: the line follows your shop's consent setting. Where Shopify shows a banner, such as in the EU and the UK, the device is linked only after a yes. Where Shopify asks for no banner, its setting allows it. See Cookieless counting and consent.
- A signed-in customer is recognized by their Shopify customer id (
data-shopify-customer). - What we keep about the buyer: the visit, the Shopify customer id (with
read_customers) and a hash of the email, never the email itself. No name or address.
What are the limits?
- One shop per project. Connecting another shop replaces the first and deletes its orders from nextanalytica.
- Shopify gives an app the last 60 days of orders, so a new connection starts with 30 days.
- The tag still counts your shop's visits: add it to your theme as Add the tag shows.
Troubleshooting
"This app and the shop are in different Shopify organizations. Create the app from the shop's own Dev Dashboard."
The app was made in another Shopify organization than the shop's. Create it again from the Dev Dashboard of the account that owns the shop.
"Shopify didn't accept the Client ID and secret. Copy both again from the app's Settings."
One of them was copied wrong, or the secret was rotated. Copy both again from the app's Settings.
"Set the app's distribution to Custom for this shop, then try again."
The app has no distribution yet. Follow step 3 of How do you create the app?, then connect again.
"Give the app the read_orders scope and release a new version."
The app was created without read_orders. Add it under the app's Versions > New version, release it, and install the app again from its install link.