How to Fetch UTM Parameters via REST API?

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

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,

2 Likes

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.

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

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

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

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

1 Like