# Track Klaviyo email campaigns in Google Analytics

Littledata integrates with Shopify sites to capture every customer touchpoint, including sales, marketing, customer and product performance data. Our Klaviyo integration works in tandem with our [Google Analytics](https://help.littledata.io/integrations/shopify-to-google-analytics/how-it-works-shopify-to-ga4) and [Segment](https://help.littledata.io/integrations/shopify-to-segment/how-it-works) connections to provide complete data for action and analysis, including audience building, LTV analysis, multi-channel campaign analysis and comparative attribution reports.

Follow this setup guide to ensure that your Klaviyo email campaigns are tracked correctly by Littledata in Google Analytics.

{% hint style="success" %}
Using Klaviyo for SMS too? Make sure to follow our [Klaviyo SMS tracking guide](https://help.littledata.io/integrations/shopify-klaviyo/klaviyo-sms-clicks)
{% endhint %}

### How Littledata works with Klaviyo

Using **Klaviyo with Google Analytics** will ensure that the store sees attribution of Klaviyo campaigns to sales and Customer Lifetime Value (LTV)

* Klaviyo adds UTM parameters to track the campaign source in Google Analytics
* Littledata sends shopping behavior events and orders into Google Analytics
* L﻿ittledata links everything together behind the scenes

{% hint style="success" %}
Using the [Klaviyo destination in Segment](https://help.littledata.io/integrations/shopify-to-segment/shopify-segment-klaviyo), the events Littledata adds can be shared back with Klaviyo.
{% endhint %}

### Using Klaviyo with Google Analytics

Klaviyo works alongside Littledata's [Shopify to Google Analytics connection](https://help.littledata.io/integrations/shopify-klaviyo/broken-reference), ***as long as email UTM parameters are set up correctly.***

For setup of Klaviyo **SMS campaigns** see our [SMS tracking guide](https://help.littledata.io/integrations/shopify-klaviyo/klaviyo-sms-clicks).

#### How to set up UTM parameters

UTM parameters are extra data in the link that the user clicks to tell Google Analytics (and [Shopify](https://www.shopify.com/blog/marketing-attribution)) where the click came from. These parameters are automatically added by Google Ads, but for other platforms (e.g. [Facebook](https://blog.littledata.io/2017/02/08/6-reasons-facebook-ads-dont-match-the-data-you-see-in-google-analytics) or Klaviyo), you will need to add them manually or via the software.

#### Recommended settings

To provide the most reporting flexibility, we recommend having the same UTM parameters across all email flows and campaigns. You can set those up under the Account .. Settings .. UTM tracking menu.

![Enabling UTM tracking](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-1e3793396fa7b2dae0a73723e667da87de85eb65%2Fscreen-shot-2022-07-27-at-3.21.06-pm.png?alt=media)

Klaviyo allows [dynamic variables](https://help.klaviyo.com/hc/en-us/articles/115005247808-Klaviyo-and-Google-Analytics-Tracking#about-klaviyo-s-utm-parameter-options3) to be used in your default UTM tracking settings. To get the most out of your Klaviyo reporting in GA, we recommend using **static values** for Medium, and **dynamic values** for Campaign, ID, Customer and Content. We *don't* recommending `flow` as the Medium, since this this does not map to a default channel in GA.

With static values for Medium (`email`), you will be able to see Klaviyo compared against other marketing channels in Google Analytics, and in particular, how Klaviyo campaigns contribute to [customer lifetime value](https://blog.littledata.io/2020/09/30/3-deep-dives-into-customer-lifetime-value-for-ecommerce-sites) and other key metrics for Shopify sales and marketing.

![Klaviyo UTM setup](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-02f592105a29186466427d45528907d54f30b35c%2Fscreenshot-2022-11-21-at-20.02.44.png?alt=media)

If you don't use Klaviyo for all the emails you send to your customers you might consider using static value of 'Klaviyo' for `source`, but since Klaviyo only allows you to add the dynamic ***List or Segment*** as a source we think that is most useful.

Here's the full tagging list:

| **UTM Parameter** | **Campaign Value**      | **Flow Value**          |
| ----------------- | ----------------------- | ----------------------- |
| Source            | *List or Segment name*  | *Flow name*             |
| Medium            | email                   | email                   |
| Source            | *Campaign name*         | *Flow message name*     |
| Id                | *Campaign id*           | *Flow id*               |
| Term              | *Link text or alt text* | *Link text or alt text* |
| Customer          | *External id*           | *External id*           |

{% hint style="success" %}
Many Littledata customers create [internal spreadsheets](https://docs.google.com/spreadsheets/d/1fzZ8YxwNwC1elYbzMhWZTurbwGHEzI1ILWXNvCxMMR4/template/preview) to manage UTM naming conventions as well as channel groupings for Google Analytics and run regular QA checks to ensure consistency.
{% endhint %}

#### Enabling UTM parameters

In addition to setting up the UTM Parameter values in your Klaviyo account, you need to **enable UTM tracking** to ensure that those parameters are applied to all emails in flows and campaigns.

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-8de2d983af25fd9583993993905ac908528f5b47%2Fscreen-shot-2022-07-27-at-3.36.14-pm.png?alt=media)

* On the left side of the UTM parameters table, switch each one to **ON**
* When creating/editing a campaign, go to **Tracking** and make sure that **'Include tracking parameters'** is **ON** and **'Customize tracking parameters'** is **OFF**

#### Reporting on Klaviyo flows in Google Analytics

Google Analytics is a powerful reporting tool once you get to know how channel groupings and custom dimensions work. You can analyze your Klaviyo campaign conversions in Google Analytics, alongside other marketing channels with multi-channel attribution.

After you have enabled our recommended settings for UTM tags, you will have access to Klaviyo flow and campaign data in Google Analytics. To see revenue and orders attributed to these campaigns, drill into the `Email` channel and add `campaign` as a secondary dimension.

If you set up the Flow email name as the `utm_campaign` above, then you can look at the contribution of that whole flow to sales. For example, without caring if the user clicked on email 1 or 2 in a 4-email flow, did clicking on *any* of the emails in that flow -- for example, the 'Browse Abandonment' flow -- result in sales?

{% hint style="success" %}
Additionally, you can [create a segment](https://support.google.com/analytics/answer/3123951?hl=en) of users who came via an Instagram campaign, and see to what degree they were influenced by the email sequence.
{% endhint %}

#### Will Google Analytics match Klaviyo?

Klaviyo offers **cooperative last touch attribution**. This means that they give email and SMS their own configurable attribution window and attribute purchases to the last Klaviyo message a customer interacted with within the attribution window.

By default, Google Analytics uses the **last-click** attribution model. All credit is assigned to the last channel a user engaged with, and any previous interactions are ignored.

Klaviyo attribution is always more greedy - ignoring contributions from other paid ads or organic visits - so the conversions you'll see in Google Analytics will always be lower.

Under the **Advertising > Model Comparison** in Google Analytics, you can compare the default email attribution in GA with other attribution models more similar to Klaviyo's dashboard.

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-7b9beed168e12e6b30ca5bb81b72de0edff87052%2Fmultichannel.gif?alt=media)

You can also look at the **Multi-Channel Funnels > Top Conversion Paths** report to see where Klaviyo fits into the user journey on your ecommerce site.

{% hint style="success" %}
Google Analytics data can also be [used as a source](https://www.littledata.io/shopify) for other reporting tools, such as Looker Studio and Tableau.
{% endhint %}

### Using Klaviyo with Segment

[Littledata's Shopify source for Segment](https://help.littledata.io/integrations/shopify-to-segment/how-it-works) automatically sends a rich data set for use with a range of Segment destinations.

Littledata's [Segment connection](https://help.littledata.io/integrations/shopify-klaviyo/broken-reference) gets all of the post-click events into Segment, and it also sends any event associated with an email address onto Klaviyo as well - providing a richer set of events, without a developer, than Klaviyo's own [Shopify event tracking](https://help.klaviyo.com/hc/en-us/articles/115005080407-Integrate-with-Shopify#add-web-tracking-to-your-shopify-store3).

For example, you can retarget users in Segment who have purchased a certain value or got certain products to a stage of the checkout - all without writing a line of code.

And by connecting the [Klaviyo destination](https://segment.com/docs/connections/destinations/catalog/klaviyo) to [Littledata's Shopify source for Segment](https://help.littledata.io/integrations/shopify-to-segment/how-it-works), email opens and clicks will also be gathered.

{% hint style="success" %}
Read more about [how Littledata's Segment connection works](https://help.littledata.io/integrations/shopify-to-segment/how-it-works) and [Segment's Klaviyo source documentation](https://segment.com/docs/connections/sources/catalog/cloud-apps/klaviyo).
{% endhint %}

Email marketing platforms such as [Klaviyo](https://segment.com/docs/connections/destinations/catalog/klaviyo/#server-side-track), require an email property with any server-side event in order to associate events with a customer (they cannot use an `anonymousId`). Littledata adds that `email` property whenever an email address is set in the user `traits()` object (in device-mode) or from the Shopify customer record (in cloud-mode).

Klaviyo can only accept events linked to a user email, so other anonymous events need to be filtered out or ignored to avoid delivery errors.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.littledata.io/integrations/shopify-klaviyo/track-klaviyo-campaigns-in-google-analytics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
