Re: How to Fetch UTM Parameters via REST API?

How to Fetch UTM Parameters via REST API?

trueimage
Tourist
6 0 1

Hi, Does anyone know how to fetch UTM Parameters via the REST API?It's very important for us to analyze the source of our orders. We can see UTM parameters on the order details page. But we can't find the data in the REST API. If UTM parameters cannot be fetched through the REST API, does it mean they can only be obtained through the GraphQL API? Thanks for your answer. True Image Team

Replies 4 (4)

Liam
Shopify Staff
2807 310 805

Hi True Image Team,

 

Shopify does capture UTM parameters for orders, and they can be seen in the Shopify Admin under the order details. However, accessing this data programmatically can be a bit tricky - the standard REST API endpoints for orders do not expose UTM parameters directly. If you're fetching order details via the REST API, you won't see fields for UTM parameters in the response.

 

As you might have found, the GraphQL API provides more detailed and granular access to data, including marketing attribution data. You can use the Order object's registeredSourceUrl field in the GraphQL API to access some of this information. Is using GraphQL for this a blocker for you?

 

Hope this helps,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

trueimage
Tourist
6 0 1

Hi Liam,

 

Thank you for your reply. Yes our team has limited knowledge of GraphQL. That's why I asked if it is possible to fetch UTM data using REST API now or in the future. That will be great if shopify will make it available via REST API.

 

True Image Team

Alex_Attribuly
Shopify Partner
18 1 13

Hey True Image Team, 

 

We have tried webhook events to fetch UTM parameters, but according to Shopify's response, there is a bug. So I think currently both rest API and webhook are not working. 

Alex_Attribuly_0-1694751046134.jpeg

 

A lot of Attribuly users request order sources so we build it for free like this. 

Alex_Attribuly_1-1694751356576.png

We also provide an open API for you.  Feel free to try it  here

Managing Attribuly. Get customer buying journey across all channels, build a better funnel with attribution, automation.
trueimage
Tourist
6 0 1

Hi Alex,

 

Thank you for your solution. It looks awesome. But we will try to set up GraphQL API by ourselves first.

 

True Image Team