Shopify: Set up your Google tag

You can measure behavioral data about your site with Google Ads and Google Analytics.

Before you begin

You can integrate your Shopify account with Google Ads or Google Analytics for free. To set up the integration, you’ll need a valid Google sign-in, a Google-provided Javascript code box, and an active Shopify account.

The instructions for setting up Google tag with Shopify are different for tag IDs starting with "AW-" (usually, Google Ads accounts) and tag IDs starting with "G-" (usually, Google Analytics properties).


If you have a tag starting with “AW-”

The easiest and the fastest way to set up your Google tag through Google Ads is to set up conversion tracking with the Google & YouTube app on Shopify.

If you do not want to use the Google & YouTube app on Shopify, you can set up the Google tag manually. Manual setup is only recommended for advanced users, as it can be complicated, and can increase the likelihood of duplicating key events, resulting in inaccurate tracking data.

If you’d like to proceed, follow the steps in this article to set up your Google tag manually.

1. Add your Google tag manually

  1. Sign in to your Google Ads account.
  2. In the upper right corner, click the tools icon, and under "Setup," click Google tag
  3. Go to the “Configuration“ tab.
  4. In the “Your Google tag” section, click Installation instructions.
  5. On the "Installation instructions" page, select “Install manually”.
  6. Within Shopify, select the "Online Store" > Themes option from the panel on the left and then select the button with three dots on your active theme > "Edit Code" dropdown.
  7. Under "Layout", choose {/}theme.liquid.
  8. In the theme.liquid file, confirm that Google tracking tags are not present. If you have code on this page that resembles the block below, you likely already have Google products installed, so double-check before replacing these.
  9. To establish a connection between your website and Google Ads, copy and paste the Google tag code below. After the <head> element, paste the code below beginning with: <!-- Google tag (gtag.js) --> and ending with </script>.
  10. Click Save to finish.
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=Tag_ID"></script>
<script>
 window.dataLayer = window.dataLayer || [];
 function gtag(){dataLayer.push(arguments);}
 gtag('js', new Date());
 gtag('config', 'Tag_ID');
</script>
Note: Don’t add more than one Google tag to each page of your website.

2. View your conversion actions in Google Ads

After you've confirmed that your configuration is live, you can view conversions to review data, make administrative changes, or update your conversion goals. Review the information below to view actions and learn more about the updates you can make in Google Ads.

  1. Sign in to your Google Ads account.
  2. In the upper right-hand corner of your account, click the Tools and Settings icon Tools and setting menu icon [Gear]. Select Measurement from the dropdown menu.
  3. Click Conversions.

Important information about conversion actions:

  • You can edit names and additional conversion actions settings in Google Ads.
  • Only the “Purchase” conversion type has the account-default conversion goals option enabled. You can choose the conversion actions you want to be included in “Conversions”.
  • The conversion window is set to 90 days.

Learn how to Understand your conversion tracking data

3. Verify and troubleshoot your conversion tracking setup

Tag Assistant allows you to verify and troubleshoot Google Tag Manager installations for Google Ads. Review the steps below to verify your conversion tracking implementation. You can only troubleshoot “Unverified” or “Tag inactive” conversions with Tag Assistant. Learn more about Tracking Statuses.

  1. Sign in to your Google Ads account.
  2. In the upper right corner, click the Tools and Settings icon Tools and setting menu icon [Gear] and under "Measurement", click Conversions.
  3. In the “Summary” table, review the “Status” column for “Unverified” or “Tag inactive” statuses.
  4. Click Troubleshoot in the “Actions” column.
  5. Click Get Started to open the Tag Assistant in a new window.
  6. Enter the URL of the web page that you want to troubleshoot.
    • It’s best to use a landing page or home page instead of the conversion page URL directly. When you visit the landing page, you can navigate to the conversion page.
  7. Click Connect to open your web page in a new browser tab.
    • The “Summary” table and Tag Assistant window remains open for use later on. Don’t close these tabs. If the conversion is “Form Submission tracking”, do a test Form Submission on the Tag Assistant connected site. Switch the tab to Preview window and verify if the tags fire at the correct location.
  8. Refresh your Google Ads account “Conversions” page. Tracking status are changed to “No Recent Conversions” in less than one minute.
  9. When the tag firing status is verified on the preview window, return to the webpage where the conversion action was tested and click Finish.

After you verify your implementation through Google Tag Assistant (and your Ad campaigns run successfully), wait at least 24 hours before you revisit the “Conversion action” section in Google Ads.

Understand tracking statuses

While you can only troubleshoot “Unverified” or “Tag inactive” conversions with Tag Assistant, Google Ads displays multiple status options. Learn more about Troubleshooting your conversion tracking status.


If you have a tag starting with “G-”

The easiest and fastest way to set up tracking through Google Analytics is to use the Google & YouTube app. Note that this integration is native to Shopify. To set up your Google Analytics tracking through Shopify, follow the steps below.

  1. Sign in to your Shopify account.
  2. On the left panel menu, open the Online store dropdown menu, then choose Preferences from the list.
  3. Navigate to the “Google Analytics account” section. Click Manage pixel here.
    1. If the Shopify app isn’t installed, review the list of permissions required, then press Add sales channel at the bottom to continue.
    2. If the app isn’t connected to Google, click Connect, then choose the Google account that owns your Analytics property.
  4. Choose your Google tag ID from the dropdown list, and click Connect your Google Analytics 4 property.
Note: If you plan on using Google Analytics to track free listings and ads conversions, check How to avoid duplicating tracking events to ensure that you do not duplicate conversion tracking.

Add your Google tag manually

If you do not want to use the Google & YouTube app on Shopify, you can set up Google Analytics tracking manually. Manual set up is only recommended for advanced users as it can be complicated, and can increase the likelihood of error, resulting in inaccurate tracking data.

If you prefer to set up tracking through Google Analytics manually, follow the steps below.

  1. In Google Analytics, go to the Admin screen.
  2. In Data Streams, click on a stream to see details.
    Your screen should show you the Google Analytics settings and the Google tag settings.
  3. In the “Your Google tag” section at the bottom of the page, click Installation instructions.
  4. On the "Installation instructions" page, select “Install manually”.
  5. In Shopify, select the "Online Store" > Themes option from the panel on the left and then select the button with three dots on your active theme > "Edit Code" dropdown.
  6. Under "Layout", choose {/}theme.liquid.
  7. In the theme.liquid file, confirm that Google tracking tags are not present. If you have code on this page that resembles the block below, you likely already have Google products installed, so double-check before replacing the existing code block.
  8. To establish a connection between your website and Google Ads, copy and paste the Google tag code below. After the <head> element, paste the code below beginning with: <!-- Google tag (gtag.js) --> and ending with </script>. Click Save to finish.
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=Tag_ID"></script>
<script>
 window.dataLayer = window.dataLayer || [];
 function gtag(){dataLayer.push(arguments);}
 gtag('js', new Date());
 gtag('config', 'Tag_ID');
</script>

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Main menu
9847956702567342571
true
Search Help Center
true
true
true
true
true
73067
false
false
false