Section 1.8: Foundations of Google Shopping

How to set up conversion tracking with Google Analytics for Shopify and Google Ads

Share

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp

When running Google Shopping ads, it's vital to your success to keep track of your actual sales amounts generated. Learn how to set that tracking up, step by step, in your Google Ads account.

Resources

Recommended lesson:

๐ŸŽฅ What is Google Merchant Center and how does it work? โžค Watch here

Additional resources:

๐Ÿ“˜ Filter domain referrals โžค Read here

๐Ÿ“˜ [GA4] Identify unwanted referrals โžค Read here

๐Ÿ“˜ Google Analytics 4: Referral Exclusion List โžค Read here

๐Ÿ‘จโ€๐Ÿ’ปGoogle Analytics Code For Your Theme

				
					<!-- Global site tag (gtag.js) - Google Analytics -->
<script type="rocketlazyloadscript" async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script type="rocketlazyloadscript">
ย  window.dataLayer = window.dataLayer || [];
ย  function gtag(){window.dataLayer.push(arguments);}
ย  gtag('js', new Date());

ย  gtag('config', 'GA_MEASUREMENT_ID');
</script>
				
			

๐Ÿ‘จโ€๐Ÿ’ปGoogle Analytics Code For Your Order Confirmation Page

				
					<!-- Global site tag (gtag.js) - Google Analytics -->
<script type="rocketlazyloadscript" async src="https://www.googletagmanager.com/gtag/js?id=KEYCOMMERCE"></script>
<script type="rocketlazyloadscript">
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'KEYCOMMERCE');
{% if first_time_accessed %}
gtag("event", "purchase", {
    transaction_id: "{{ order.order_number }}",
    value: {{ total_price | times: 0.01 }},
    tax: {{ tax_price | times: 0.01 }},
    shipping: {{ shipping_price | times: 0.01 }},
    currency: "{{ order.currency }}",
    items: [
     {% for line_item in line_items %}
     {
      item_id: "{{ line_item.product_id }}",
      item_name: "{{ line_item.title | remove: "'" | remove: '"' }}",
      currency: "{{ order.currency }}",
      price: {{ line_item.original_price | times: 0.01 }},
      quantity: {{ line_item.quantity }}
    },
    {% endfor %}
    ]
});
{% endif %}
</script>
				
			
play watch

Free Google Shopping Course

  • 42 tutorials
  • 4 hr 31 min 37 sec

Add Your Comments & Questions Below

Subscribe
Notify of
guest
7 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Jay
Jay
21 days ago

The conversion code that is needed to copy and paste in Shopify additional scripts not on the page. It mentions it being just below the video, but the code that is here isn’t the same as shown in the video.

Mr Sam Baldwin
Admin
15 days ago
Reply to  Jay

Hi Jay,

thanks for pointing that out, we just updated the page with the code for your order confirmation page.

Ayman
Ayman
17 days ago

Hi, if you could also send the Google Analytics code; the one to put in the Shopify order status page seems to be missing

Mr Sam Baldwin
Admin
15 days ago
Reply to  Ayman

Hi Ayman,

Thanks for pointing that out, we just updated the page with the code for your order confirmation page.

Michael
Michael
15 days ago

The script code posted below this video to copy and paste is completely different than what is shown in the video? You really stress how important it is to have conversion tracking setup correctly, I just want to make sure and do this right the first time. Can you please help clarify? Thanks so much ๐Ÿ™‚

Last edited 15 days ago by Michael
Mr Sam Baldwin
Admin
15 days ago
Reply to  Michael

Hi Michael,

Thank you for pointing that out; indeed, it’s vital to correctly set up the conversion tracking!
We just added the code for your order confirmation page.

Michael
Michael
15 days ago
Reply to  Mr Sam Baldwin

Thank you Sam! What an amazing course you guys have put together, providing so much value!