Tag Shopify Orders With UTM Source and Campaign

4 min setup
No coding required
Runs automatically

Shopify records the UTM parameters a customer arrived with, but it keeps them inside the order's customer journey where you can't filter or export them. This workflow reads each new order's customer journey, pulls out the utm_source, utm_medium and utm_campaign values, and adds them as order tags, so you can filter orders and build reports by the campaign that drove them.

Shopify logo icon
Shopify Order Created (Trigger)
Code Custom Code
Filter
Shopify logo icon
Shopify Order Add Tag

How it works

4 steps to see which campaign drove every order, right in your order list

Shopify logo icon

Shopify Order Created (Trigger)

App connector: Shopify • Time to complete: 1 minute

Runs for every new order.

Code Custom Code

App connector: Code • Time to complete: 1 minute

Query the order's customerJourneySummary through Shopify's GraphQL API and read the utm_source, utm_medium and utm_campaign values from the last visit's landing page.

Filter

App connector: Filter • Time to complete: 1 minute

Only continue if at least one UTM value was found.

Shopify logo icon

Shopify Order Add Tag

App connector: Shopify • Time to complete: 1 minute

Add tags such as utm_source:facebook, utm_medium:cpc and utm_campaign:spring-sale to the order.

Trusted by 1,000+ merchants
Logo: Rothy's Logo: Adidas Logo: Allure Logo: GQ Logo: DraftKings Logo: Chubbies Logo: Made In Cookware Logo: MUD/WTR

Ready to see which campaign drove every order, right in your order list

Get setup in 4 minutes.

Use this template →

FAQs

Where does Shopify store UTM parameters?

In the order's customer journey, which records the visits before the purchase and the landing page URL of each one. The workflow reads the UTM values from there.

What happens to orders with no UTM parameters?

The filter stops the workflow, so direct and untracked orders get no UTM tags.

Can I report on the tags?

Yes. Filter the Shopify orders list by a tag, or export orders with their tags to a spreadsheet to compare campaigns.

Personalize this template

Customize this workflow even further:

Use the first visit instead
Read the first visit in the customer journey to credit the campaign that originally brought the customer in.
Log campaigns to Google Sheets
Add a Google Sheets step to record each order's total and UTM values in a campaign report.

You're in good company

"MESA has been a game changer for us. And, if you ever get stuck, their support team is always super helpful."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
PetFriendly

"It's like Zapier but exactly designed for Shopify. I have been able to complete all the workflows that I've needed."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Zailys

"The MESA team has been amazing at helping us set up our automations. We would highly recommend this app!"

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Rothy's

see which campaign drove every order, right in your order list

4 min setup • Fully supported if you need help