New Shopify Certification now available: Liquid Storefronts for Theme Developers

Google Ads Conversion Tracking through Google & YouTube Channel App

kylemic
Shopify Partner
2 0 0

Hi, I'm using Google & YouTube Channel App to connect GA4. After that I'm trying to set Google Ads Conversion tracking. When adding the conversion action in Google Ads, apart from importing directly from GA4, I also need to directly track actions on my site. In this process, I need to install Google tag and event snippet. In the Google tag install section, because I've already installed GA4, so I chose the second option to add the 'config' command instead of installing the Google tag again. But since the Google tag is installed through the app, there's no place to add the config command in the theme.liquid file. And if I choose the first option to add the Google tag again in the theme.liquid file, the tag assistant prompts me that the tag is duplicated. How can I do this? 

kylemic_0-1685953088670.png

 

Replies 3 (3)
Ecommpremium
Shopify Partner
502 43 90

To address the issue you're facing with installing the Google tag and event snippet in your Shopify theme, follow these steps:

  1. First, ensure that you have the Google & YouTube Channel App properly set up and connected to your GA4 property.

  2. Instead of modifying the theme.liquid file directly, you can use Shopify's Script Editor feature to add the necessary config command. Here's how:

    a. In your Shopify admin dashboard, go to "Online Store" and then "Preferences." b. Scroll down to the "Google Analytics" section and click on "Manage tracking." c. Under "Additional Google Analytics JavaScript," click on "Add custom JavaScript." d. In the code editor that appears, add the config command for your GA4 property. It should look similar to this:

 

gtag('config', 'GA4_MEASUREMENT_ID');

 

  1. Replace 'GA4_MEASUREMENT_ID' with your actual GA4 measurement ID, which should be in the format 'G-XXXXXXXXXX'.

    e. Save the changes.

  2. Next, to add the event snippet, follow these steps:

    a. In your Google Ads account, navigate to "Tools & Settings" and select "Conversions." b. Click on the "+" button to create a new conversion action or select an existing one. c. In the "Tag setup" section, click on the dropdown menu and select "Install the tag yourself." d. Copy the event snippet provided by Google Ads.

  3. In your Shopify admin dashboard, go to "Online Store" and then "Themes."

  4. Locate your active theme and click on "Actions," then select "Edit Code."

  5. In the list of files on the left-hand side, click on "theme.liquid" or "theme.liquid" (depending on your theme) to open the main theme file.

  6. Find the closing </head> tag in the theme.liquid file.

  7. Paste the Google Ads event snippet just above the </head> tag. It should look similar to this:

 

<!-- Google Ads Event Snippet -->
<script>
  gtag('event', 'conversion', {
    'send_to': 'AW-XXXXXXXXXX/XXXXXXXXXX',
    'value': '0.00',
    'currency': 'USD'
  });
</script>

 

  1. Replace 'AW-XXXXXXXXXX/XXXXXXXXXX' with your actual Google Ads conversion ID.

  2. Save the changes.

By using the Script Editor in Shopify, you can add the necessary config command and event snippet without duplicating the Google tag. This way, you can track actions on your site while leveraging the Google & YouTube Channel App for your GA4 integration.

Remember to thoroughly test the tracking and conversion actions to ensure they are working correctly. If you encounter any difficulties or have further questions, consider reaching out to Shopify support or consulting with a Shopify expert for specific guidance tailored to your setup.

I hope this helps! Let me know if you have any more questions.

- Did we solve your issue? Like & Mark As Solution to help the community
- SKYPE: ahsanaliawan
- 300+ Video Tutorials
-Website
kylemic
Shopify Partner
2 0 0

Thanks for the reply.

 

I was actually following this Shopify Guide: https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/tracking-adwords-conversion... to add a purchase conversion tracking. After reading your solution, I have the below questions:

 

1. If I already used Google & YouTube app, is it correct that I don't need to install the global site tag from Google Ads to theme.liquid file?

2. For purchase event snippet, according to the Shopify guide, I've already added it in the Shopify's Checkout -> Additional script box, should I add it again in the theme.liquid file as your solution suggests? (Or should I remove it from Shopify admin and add it in the theme.liquid file?)

3. The Shopify guide also asks me to add the global site tag to the Shopify's Checkout -> Additional script box, should I add just the config tag 

gtag('config', 'GA4_MEASUREMENT_ID');
or should I add the full tag offered when selecting the first option in Google Ads in the screenshot?
4. I just tried directly adding the config tag above in Shopify's Custom JavaScript section, but the tag assistant give a "Invalid call to gtag(), the Global site snippet is not installed" error.
 
Thanks again for the help.
Ecommpremium
Shopify Partner
502 43 90

Hi,

Here is a complete tutorial on Setting up ecommerce purchace event tracking for GA4 and shopify.

Answer to question 1 is No you still Need for tracking store purchase ecommerce event tracking.

More over This above tutorial has your solution!

- Did we solve your issue? Like & Mark As Solution to help the community
- SKYPE: ahsanaliawan
- 300+ Video Tutorials
-Website