I want tracking who buys a product from my store, through my campaign Analytics

Highlighted
New Member
3 0 0

I want to launch an email marketing campaign with Analytics. The email sent to my potential customers will have links with a UTM like this:

?utm_source=mysource&utm_medium=mail&utm_term=shirts&utm_content=link1&utm_campaign=mycampaign

I want tracking who buys a product from my store, through my campaign Analytics.

To accomplish this, I think in to put Javascript code like this in the "thank you" page:

if ( utm_campaign == "mycampaign" ) {
    ga('send', 'sales_generated_by_campaign', 'thanks_page_accessed', 'purchase_completed');
}

But, how to recover the value of the variable "utm_campaign" from UTM, with which the customer initially entered in my shop?

0 Likes
Shopify Expert
246 0 38

utm tracking parameters are automatically used by Analytics for campaign and source of a session. You can use that to show Transaction or Goal reports dispaying the Campaign/Source information.

Technical SEO Consultant - Specialising in setting up Structured Data for Rich Snippets, Google Analytics for advanced reports and the Google Search Console for efficient crawling.
0 Likes
New Member
3 0 0

That means that when a purchase is completed, Analytics detects whether that purchase came from the campaign X or Y, or did not come from any campaign?

0 Likes
Shopify Expert
246 0 38

Yes, 

The campaign information is stored for the whole session of a users visit. If they purchase, trigger goals or events, they are associated with that campaign.

Technical SEO Consultant - Specialising in setting up Structured Data for Rich Snippets, Google Analytics for advanced reports and the Google Search Console for efficient crawling.
0 Likes
New Member
3 0 0

Oh, amazing! I thought it was more difficult!

Thank you very much, Tony McCreath!

0 Likes
Shopify Partner
22 0 0

can purchase goals from a thank you page be tracked even though the checkoutpage links out to a different domain?

0 Likes
Shopify Expert
246 0 38

can purchase goals from a thank you page be tracked even though the checkoutpage links out to a different domain?

They can. To make it work you need to place that other domain in your Referral Exclusion list, which is in your Analytics settings for the Properties Tracking Info. Otherwise that domain will steal credit for the sale. 

Technical SEO Consultant - Specialising in setting up Structured Data for Rich Snippets, Google Analytics for advanced reports and the Google Search Console for efficient crawling.
0 Likes
New Member
15 0 0

Google analytics is a valuable ally in the ecommerce battle for consumer dollars. The insights it provides contains a wealth of information about your site, your visitors and where they came from. All this information can be used to find new customers and increase conversions.

For many ecommerce entrepreneurs just starting out, Google Analytics can feel like a confusing mess of technical reports and information that’s difficult to navigate and understand.

0 Likes