Export UTM Parameters From Your Shopify Order Data to CSV With EZ Exporter

One way to keep track of how well your marketing campaigns are doing is by using UTM parameters. Our app EZ Exporter now supports a function for extracting individual UTM parameters and place them in separate columns in the CSV file to make it easier for you to analyze the data.

UTM parameters are basically just these additional strings that you add at the end of a URL in the format of key=value so you can parse them later and get additional information to help you identify where a traffic came from.

Here's a quick example:

https://www.example.com?utm_source=newsletter&utm_medium=email&utm_campaign=2019%20summer%20sale

The long string after the "?" character are the UTM parameters. From this URL, you can tell that the visit came from a newsletter by looking at utm_source=newsletter.

In the case of Shopify, when a customer visits your store and then places an order, Shopify records the initial URL where the customer landed on your site before making a purchase. This is stored in the order data in a field called landing_site.

If the link the customer clicked on to get to your site contains UTM parameters, then this will be recorded in this field as well and now you know how that customer got to your site.

Here's an example of what this looks like in the Shopify order data as returned by the API:

/?utm_source=newsletter&utm_medium=email&utm_campaign=2019%20summer%20sale

The above data tells you that the customer got to your site from a link in your email campaign named "2019 summer sale."

As you can see, this is not very easy to read as certain characters are encoded and this could potentially get very long. This is where EZ Exporter comes in.

We added a function called get_url_query_param_value() that will allow you to extract just the UTM parameters that you care about in separate columns in the exported CSV file. This will make it much easier to read and analyze the data.

For example, if you just want to extract the values of utm_source and utm_campaign, you can use the following formulas in Calculated Fields:

get_url_query_param_value({{ landing_site }}, "utm_source")
get_url_query_param_value({{ landing_site }}, "utm_campaign")

Export Shopify UTM Parameters with EZ Exporter

The CSV output will look something like this:

Export Shopify UTM Parameters with EZ Exporter App

This function is not limited to just UTM parameters, you can use it to extract any query parameters from the URLs. We've also added a template in our app that already has these formulas configured to make it very easy to get started.

Tags: shopify, ez exporter, howto, tips, ecommerce, marketing