Add Google Ads conversion tracking to Shopify quickly. Choose from three versions:
- Additional Scripts: Deprecated but still installable.
- Shopify Pixel: Direct installation with Google Ads, excluding enhanced conversions.
- Shopify Pixel with Enhanced Conversion & Micro Conversions + GA4: Available when installing via Google Tag Manager.
The Shopify Pixel Code is compatible with Shopify checkout extensibility.
Please note that users checking the code with Tag Assistant or developer tools will not be able to see the code, as Shopify pixels run in sandbox mode, which is not viewable.
Please also note that if you are installing this with Google Analtyics 4, that you will not be able to view the debug mode in GA4. But you can view the realtime data to verify it’s tracking.
Enhanced conversions will be reflected in the status details within a week, depending on your sales volume.
Shopify Pixel + Enhanced Tracking + Micro Conversions + GA4
What is New?
- V1.05+ now supports cart data, for using cost of goods based bidding strategy in Google Ads
- V1.07+ now supports micro conversions + bug fixes
- V1.08+ now supports Google Analtyics 4 (optional)
- V2+ now supports remarketing & remove from cart
What is the difference between Micro and Macro Conversions?
When it comes to advertising, we have two types of conversions. Macro and Micro conversions. Macro conversions are the website’s primary conversions, such as completing an order or submitting a lead form. Micro conversions are smaller actions such as add to cart, view cart, add a delivery address, etc.
Requirements
You need access to the following accounts.
- Google Tag Manager
- Google Ads
- Google Analytics 4
- Shopify (Customer Events)
Let’s get started!
If you have not yet created a Google Tag Manager account, create one now.
Once the account is created, you should see a popup with your GTM tag, if you don’t see this, don’t worry, simply go to Admin > Install Google Tag Manager
Copy the tag id without GTM- as highlighted in the image below
Replace the following values in the settings:
- GOOGLE_TAG_MANAGER_ID
- Add your GTM tag ID
- GOOGLE_MERCHANT_CENTER_ID
- Add your Google Merchant Center account ID
- PRODUCT_COUNTRY_CODE
- Set your default country ISO2 code, for usage in product IDs
- ESTIMATED_SHIPPING_TIME
- Add your estimated shipping time
- GRANT_CONSENT
- Defaulted to false, if you set it to true, you are forcing to set consent_mode v2 to true, regardless what the use selected (not recommended)
- ID_TYPE
- Set your Google Merchant Center product ID format
- CAPITALIZE_SKU
- If you are not using the default Shopify IDs and you are using SKUs, you can choose to uppercase the value
In the code replace GTM-123456 with your GTM tag ID
You can get the code by registering here: https://feedarmy.io/product/enhanced-tracking-pixel-for-shopify/
Go to Shopify > Settings > Customer Events
Click on add custom pixel
Paste your code, click on save and then connect.
In Google Tag Manager, go to admin > and click on import container.
GTM JSON File
In Google Tag Manager select the json file (you can find it in the downloaded file).
Chosing your workspace, click on existing and choose default workspace
Select Merge as the import option
Click on confirm
Go to Workspace > Tags > Click on Google Ads Shopify Pixel Conersion Tracking By FeedArmy
Hover over the tag and click on edit
Add your Google Ads conversion ID and Label when creating a new conversion.
In Google Ads go to Goals > Summary > Click on New Conversion Action
Select website
Enter any website domain, and click on scan
Scroll to the bottom of the page and click on Add a conversion action manually
Add your conversion action details:
For Goal and action optimization select purchase
For Conersion name, add any name, I recommend Shopify GTM Pixel
For the Value select Use different values for each conversion
Click on Done, then click on save and continue
Select Google Tag Manager and copy your id and label from Google Ads and paste it in Google Tag Manager
Now repeat the steps for the micro tracking (optional) (view the instructions video for more details) and ensure everything is set to secondary as goal, unless you know what you are doing:
- Add To Cart
- Remove From Cart
- Cart Viewed
- Begin Checkout
- Add Shipping Info
- Payment Submitted
- Search
- View Collection
Save the tag, and now lets publish the GTM container by clicking on Submit
Add a version name and click on publish
Let’s enable enhanced conversions in Google ads by clicking on done, then select your conversion action and click on ehanced conversions.
Check the box next to Turn on enhanced coversions
Check the radio button for Google tag or Googel Tag Manager and select next
Enter just a letter d, and click on check URL, as we want to force an error.
We can now click on select one manually
Click on Google Tag Manager > Next and click on save
Google Ads Remarketing
To enable the Google Ads Remarketing setup, we only need to copy the Google Ads conversion ID. You can find this by going to Goals > Select any website conversion action, such as the ones you just created, and copy the id.
And paste the conversion ID in the remarketing tag inside Google Tag Manager.
Google Analytics 4 Setup
Continue GA4 Installation: We now need to add our Measurement ID
- Tags:
- Google Analytics 4 Data
- Google Analytics 4 Page View
You can find your Google Analytics Measurement ID by going to:
- Google Analytics
- Cog Icon (admin)
- Under Data collection and modification, choose Data Streams
- Click on your data stream
- Now you can view and copy your measurement id
Now click on both tags, and add replace the G-1234 that I added, with your own measurement ID.
Support My Work!
https://www.trustpilot.com/review/feedarmy.com
or here : https://g.page/r/CbGZ-JICOoh1EAg/review
Trouble Shooting
Can Not See Data Layers
Because Shopify pixels run in sandbox mode, for privacy reasons, you cannot view data layers in your browser using conventional tools.
You will need to use a Chrome extension such as https://chromewebstore.google.com/detail/datalayer-checker-plus/blglfmihmnbhfgfbomofeljmididgfhe
Even then, it is only sometimes 100% working.
Zero Tracking
If nothing is working, even adding to the cart, that signals more serious issues. This means there is possibly a third-party app blocking pixels from working.
It’s also possible that your cookie consent is not enabling tracking, you can test by forcing the consent to be set as accurate in the code settings.
Some Conversions Are Tracking
If you notice that not all conversions are tracked in Google Ads, this signals that the payment method you are using is not sending back the correct data to Shopify. This is a known issue with third-party payment methods, even with the old additional script method.
Conversion Not Working
If your conversions are not working, then most likely your theme checkout and thank you page are not published.
Go to Shopify > Online Store > Themes > Click on Customize
Click on the home page drop down and select Checkout and new customer accounts
Click on checkout drop down and choose thank you and or checkout (whichever says unpublished)
Click on the sections button and publish.
You can also check if your checkout domain matches your domain. In some cases the domain name is myshopify.com instead of your domain.
Google Analytics Average Engagement Time Per Session
When using Shopify Pixels / Customer Events, and due to Shopify using sandbox environment, automatic events, including engagement event for Google Analytics aren’t triggered.
Change Log
- 29 October 2024: V2 Includes remarketing, remove from cart micro conversion.
- 6th October 2024: V1.0816 Fixed purchase report issue in GA4 (just update the pixel code in Shopify)
- 2nd September 2024: v1.0814 Fixed the pixel code to correctly show the item_id instead of the id (For GA4).
- 2nd September 2024: V1.0813 Fixed an issue with event naming convention
- 25th August 2024: V1.08+ now supports Google Analytics 4
- 8th August 2024: V1.07+ now supports micro conversions + bug fixes
- 16th July 2024: Updated GTM enhanced conversion data to be lowercase, as per documentation and highlighted by Lowie Verschelden
- 14th July 2024: Added V1.05 cart data, so that you can use Google Ads cost of goods based bidding.
- 18th June 2024: Added conditional checks for enhanced data to avoid listing empty values
- 10th June 2024 : Updated GTM Container, incorrect mapping of some variables (to update please delete all variables in GTM, and re-import with merge option)
Shopify Pixel
This Shopify Pixel / Customer Event code, has been tested and verified as working for Shopify merchants that have enabled Checkout Extensibility.
The first step is to get your conversion id and label.
Log in to Google Ads and go to Goals > Conversions > Summery
Click on the blue button that says + New conversion action
Select Website as your conversion method.
Enter your website address, and scan.
If you see a banner that says to use Google Analytics, then click on Use Google Ads only
Click on +Add conversion action manually.
- Choose Purchase as your Goal and action optimization
- Enter any conversion name, I will call it Shopify Pixel
- Select Use different values for each conversion
- Leave the rest unchanged and click on done
Click on See event snippet
Copy the code and paste in a temporary text file, we will copy some details at a later stage.
Click on Done.
Now go to Shopify > Settings > Customer Events
And click on Add custom pixel
You can give it any pixel name, but I will call it Google Ads Conversion. Now click on Add pixel.
When editing the code below, please do not remove or change the author, and respect who built it.
// Created by FeedArmy V1.04
Paste the below code in the Shopify pixel.
// Created by FeedArmy V1.05
const script = document.createElement('script');
script.setAttribute('src', 'https://www.googletagmanager.com/gtag/js?id=AW-123456789');
script.setAttribute('async', '');
document.head.appendChild(script);
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-123456789', {'allow_enhanced_conversions':true});
analytics.subscribe("checkout_completed", (event) => {
gtag('set', 'user_data', {
email: event.data?.checkout?.email,
phone: event.data?.checkout?.phone,
address: {
first_name: event.data?.checkout?.shippingAddress?.firstName,
last_name: event.data?.checkout?.shippingAddress?.lastName,
street: event.data?.checkout?.shippingAddress?.address1,
city: event.data?.checkout?.shippingAddress?.city,
region: event.data?.checkout?.shippingAddress?.province,
postal_code: event.data?.checkout?.shippingAddress?.zip,
provinceCode: event.data?.checkout?.shippingAddress?.provinceCode,
country: event.data?.checkout?.shippingAddress?.country,
countryCode: event.data?.checkout?.shippingAddress?.countryCode,
}
});
gtag('event', 'conversion', {
send_to: 'AW-123456789/abcdefg123456789',
transaction_id: event.data?.checkout?.order?.id,
value: event.data?.checkout?.subtotalPrice?.amount,
currency: event.data?.checkout?.subtotalPrice?.currencyCode,
});
});
From your previously copied code from Google Ads, copy the AW-123456789 id highlighted in the image below.
And paste it twice on row 3, and row 10, by replacing the existing ID AW-123456789 (shown in red in the image above)
Go back to your Google Ads code and now copy the full ID and Label as highlighted in the image below.
Replace the send_to value between the quotes on row 14. (shown in red in the above image)
Now click on save in the top right corner followed by clicking on Connect, accept Shopify terms and conditions. And you are all done.
Testing
You can’t test code on Shopify’s checkout thank you page because it’s in sandbox mode, meaning tools like Google Tag Assistant or GTM Preview Mode won’t work. While you could use console.log to check data, I think it’s unnecessary effort. The code does work. Simply wait for a sale to confirm that it’s tracked in Google Ads as a conversion when it comes from an ad click or wait until you have any sale, Google Ads will show the code is detected.
Change Log
- V1.05 – 20 May 2024: Changed the order of gtags
- V1.04 – 20 May 2024: Added user_data values after Sve (comment below) confirmed Google’s own version. I already built this months ago, but needed confirmation it’s correct.
- V1.03 – 02 March 2024 : Supports multicurrency and used subtotal price instead of total
- V1.02 – 27 February 2024 : Public Release
Support My Work!
My conversion tracking code is constantly updated and provided free for anyone to use. As I don’t ask for any monitary value in return, I would be grateful if you consider leaving a review: https://www.trustpilot.com/review/feedarmy.com
Additional Scripts
Supported Functions
- Automatically supports multi currencies.
- Automatically converts European prices with commas to dots.
- Optional choice for disabling tax and shipping in your checkout value.
- Includes the new Google Ads enhanced conversion option
Requirements
- Access to Google Ads > Conversions
- Access to Shopify > Settings
Step 1: Open Shopify Checkout Settings
Open a new tab in your browser and log in to your Shopify Admin Panel
Navigate to Settings (Gear Icon) and choose Checkout
Step 2: Setup & Copy Your Google Ads Conversion Code
In a second browser tab, login to Google Ads and click on the tools and settings menu in the top right corner and select Conversions under the Measurement column.
Click on the big blue plus sign (New Conversion Action).
Now select website as your tracking template.
It will now ask you to scan your website URL. Enter your URL and click on scan.
Scroll to the bottom and choose to install the conversion action manually.
Then do the following :
- Conversion name
- enter any name
- Category
- Purchase / Sale
- Value
- Use different values for each conversion
- Attribution model
- Choose Position-Based (recommended for growth based businesses)
- The rest can be as default
I have written a great article on how to choose your attribution model.
Click on Create and continue
Now you can click on Save And Continue
Click on See Event Tag
Copy your Event Snippet and save it in a temporary file, for later use.
Click on Done
Click on the recently added conversion action
Enabling Enhanced Conversions is optional and not required. Some accounts may not see this option yet. So you can continue the steps below, excluding those related to enhanced conversions. (Skip to Step 3)
Now go to Tools and Settings > conversions > settings or click here: https://ads.google.com/aw/conversions/customersettings
By enabling enhanced conversions you allow Google to improve its accuracy to track conversions. This seems to be required due to Apple’s IOS14 no tracking prompt.
After you have checked the box and clicked on save, you will get a terms and conditions prompt, read it and confirm.
Now choose Google Tag and click on Tag Details.
Now check the box next to Specify CSS selectors or JavaScript variables
- Change CSS selector to Global Javascript variable
- Enter the following values for Email
- enhanced_conversion_data.email
Repeat the steps for Phone number and Name and Address
- Phone
- enhanced_conversion_data.phone_number
- First name
- enhanced_conversion_data.first_name
- Last name
- enhanced_conversion_data.last_name
- Street address
- enhanced_conversion_data.home_address.street
- City
- enhanced_conversion_data.home_address.city
- State
- enhanced_conversion_data.home_address.region
- Country
- enhanced_conversion_data.home_address.country
- Postal code
- enhanced_conversion_data.home_address.postal_code
You might ask, why the javascript values? Well on your thank you page, the javascript selector for all the values is added as a javascript variable when using the conversion tracking code below (From V1.5). This will only work if you use the code below.
Step 3: Editing and Pasting Your Google Ads Conversion Tracking
Go back to Shopify and scroll down until you see Order Processing (from step 1), at the bottom of this section you will have a field where you can paste code that is labeled Additional Scripts.
If you have two fields such as post purchase and order status, then add the code to the order status field.
Copy the send_to value (image below) and replace fa_send_to value with your value in the code template below.
- replace the value for fa_send_to
- replace the value AW-123456789/abcdefghijlklmnopq with your event snippet send_to value
- Choose yes or no for fa_include_tax_and_shipping
- choose yes if you want to include tax and shipping in the checkout value or no to not include tax and shipping values.
Sometimes on rare occasions, when you set fa_include_tax_and_shipping to no, it would still include the shipping. I’m not sure why this sometimes happens, but it might have to do with the account country. So if you notice shipping is included, set the value to yes, and it will remove shipping.
Code Template (change the fa_send_to value with your code snippet send_to value)
<!-- FEEDARMY START Global site tag (gtag.js) - Google Ads V2.2 -->
<!-- For the latest and updated code or tutorial: https://feedarmy.com/kb/adding-adwords-conversion-tracking-to-shopify/ -->
{% assign fa_send_to = 'AW-123456789/abcdefghijlklmnopq' %}
{% comment %}DO NOT EDIT BELOW{% endcomment %}
{% if fa_google_coding %}{% assign fa_google_coding = true %}{%- else -%}{% assign fa_google_coding = false %}{%- endif -%}
{% assign fa_google_ids = fa_send_to | split: "/" %}
{% if fa_google_coding == false %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{fa_google_ids[0]}}"></script>
{%- endif -%}
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{fa_google_ids[0]}}', {'allow_enhanced_conversions':true});
var checkout = window.Shopify.checkout;
</script>
{% if first_time_accessed %}
<script>
gtag('event', 'conversion', {
'send_to': '{{ fa_send_to }}',
'value': checkout.total_price_set.presentment_money.amount,
'currency': checkout.total_price_set.presentment_money.currency_code,
'transaction_id': '{{ order_id }}',
});
var enhanced_conversion_data = {
{% unless billing_address.first_name == blank %}"first_name": "{{ billing_address.first_name }}",{% endunless %}
{% unless billing_address.last_name == blank %}"last_name": "{{ billing_address.last_name }}",{% endunless %}
{% unless checkout.email == blank %}"email": "{{ checkout.email }}",{% endunless %}
{% unless billing_address.phone == blank %}"phone_number": "{{ billing_address.phone }}",{% endunless %}
"home_address": {
{% unless billing_address.street == blank %}"street": "{{ billing_address.street }}",{% endunless %}
{% unless billing_address.city == blank %}"city": "{{ billing_address.city }}",{% endunless %}
{% unless billing_address.province_code == blank %}"region": "{{ billing_address.province_code }}",{% endunless %}
{% unless billing_address.zip == blank %}"postal_code": "{{ billing_address.zip }}",{% endunless %}
{% unless billing_address.country_code == blank %}"country": "{{ billing_address.country_code }}"{% endunless %}
}
};
</script>
{% endif %}
<!-- FEEDARMY END Global site tag (gtag.js) - Google Ads V2.2 -->
Verifying and Testing
Verifying
You can verify if the code is working if you go to Google Ads > Tools and Settings > Conversions > here check if the status is verified.
Testing
First open up Tag Assistant when the new window opens up make a test payment to check if the conversion tracking is correctly installed. When you are on the final thank you page check the data within Tag Assistant.
Tip:
first_time_accessed
is for the page, not for the customer. Subsequent orders will run afirst_time_access
again for the same person if it is a new browser session.
Trouble Shooting Enhanced Conversions
Make sure you have waited at least 3 to 7 days. Google requires time to compile the data.
Coverage:
You may encounter issues with regard to coverage. This can happen when customers pay through a third-party payment processor (PayPal), which may require that they enter customer data on a different domain instead of directly on your website like they do when they do not use a third-party payment processor.
Match status:
If you are having issues with the match status, not all users fill out all the fields in your checkout. What you could do is remove the attributes in your Google Ads conversion list to only track emails or only track mandatory fields in your checkout.
By removing non-mandatory fields, you will avoid submitting empty fields to Google.
Change Log
- 8th September 2023 – updated the steps for enhanced conversion tracking
- V2.2 – 11 July 2023 – updated code to validate every value
- V2.1 – 24 June 2023 – updated checkout price to use presentment_money
- V1.8 – 10 August 2022 – Added enhanced conversion checks for email and phone number
- V1.7 – 07 June 2022 – Fixed incorrect total value when changing shipping and tax settings
- V1.6 – 28 April 2022 – Fixed the country code not adding the value correctly as highlighted by Jon Yildiz
- V1.5 – 27 July 2021 – Added Enhanced Conversions using Javascript and removed CSS
- V1.4 – 21 July 2021 – Added Enhanced Conversions using CSS
- Due to server migration, older changes are not listed
Support My Work!
My conversion tracking code is constantly updated and provided free for anyone to use. As I don’t ask for anything in return, I would be grateful if you consider leaving a review: https://www.trustpilot.com/review/feedarmy.com
Thank you for your quick response, it helps us a lot, you are a great worker and deserves recognition.
Since I am using Cookiebot and it has an automatic blocking line ( https://consent.cookiebot.com/uc.js) should I use it in your Pixel script or in the page code? And should I use the False or True variant in “const GRANT_CONSENT” ?
Where you install your cookie tracking, does not matter, as far as I know. GRANT_CONSENT should be false, as you don’t want to force it to be true all the time.
Hi Sir my conversion is showing but conversion value is not showing.
Try to test the data layers using: https://chromewebstore.google.com/detail/datalayer-checker-plus/blglfmihmnbhfgfbomofeljmididgfhe
Hi, my Shopify site from Germany. The problem is google conversion tracking stopped recording data. I am using Google & Youtube sales channel. Any solution? Kind Regards,
Have you tried my code?
I have only google tag manager and Google ads account. Your code seems optimized for google merchant account and google analytics. is there any solution for me? I tried many tutorial and all fine. Events firing when I see the google tag assistant or google tag manager. The problem is data not counting to my google ads account. I dont know whats the problem. Let me know if there is any solution for my site. Kind Regards,
Understood, if you want to try out my setup, consider installing the setup from my guide. Only then will you know if it works.
Hello! Congratulations on the excellent work. I’ve been using your Pixel script for some time now and it seems to work very well, even though I have some problems with the cookiebot, it is being the basis of our store, thank you very much. After some remarketing analysis, it was noticed that the hits of the “google_business_vertical”, “ecomm_prodid” and “ecomm_totalvalue” parameters are low (8/day), especially compared to the time when we used your complementary scripts on Shopify and remarketing was done with the “value” and “id” parameters, which still send quite high hits (270/day). Could you suggest a solution for the problem?
THank you for the kind words. Yes, I have heard this before, and I have noticed this on some accounts, but I have not investigated what dropped. You might want to compare the pages before and after the code, see which pages had a lot more traffic. I can investigate if you report back if it’s like collections, homepage, etc. I believe it would other pages.
Hey Emmanuel!
I’ve used your Shopify pixel direct installation setup on our Google Ads for quite some time, and have seen a big difference in the conversion value reported compared to our old way of imported purchase conversions from GA4.
It says enhanced conversions is set up and active which is great, can I just check I’m fine to stick with this method rather than switching to your tag manager installation? Would like to get away with leaving the setup as we have it now if possible… but your guide says excluding enhanced conversions for the Shopify pixel method I used?
Can I leave as it is if it says enhanced conversions is setup and fully optimised? Also is it correct to see a big discrepancy in the revenue reported between GA4 and Google Ads since it’s directly installed within Google Ads? Thank you!
If the enhanced conversions are working, yes you can leave it. When I tested it long time ago, enhanced conversions did not seem to work. So maybe something changed on Googles or Shopify side for it to work correctly. As this code was my first attempt at this kind of setup.
Hello!
I have some problems with tracking clicks on email and phone number on my shopify v2.0 website.
Do you have any tutorials about that?
Thanks in advance!
Unfortunately not at the moment.
Hey Emmanuel! I noticed the article was updated on December 21st but nothing is in the change log? Were there any big changes to be aware of?
I’ve just back off annual leave and have returned to the new version of Tag Assistant, which is showing no tags across all of our Shopify order status pages, so was hunting around to see if there were any updates relating to this.
There is no update, I just removed mention of the upgrade files.
I have used the Pixel method but it still shows inactive even after 3 days, although the purchasing is happening. Can you help
If it doesn’t work, please check the troubleshoot steps at the bottom of the guide.
Hello Emmanuel, thank you for this guide!
I have a question: Google wants a phone number formatted with a + and country code. Like this:
Example: ‘+11231234567’
https://support.google.com/google-ads/answer/13258081?hl=en#zippy=%2Cidentify-and-define-your-enhanced-conversions-fields
However, when I use the DataLayer Checker Chrome app, I see:
But I believe I should see:
…with the +1 being the USA country code in my example.
Shopify’s documentation states that the returned phone number should be:
phone
(string | null)
A unique phone number for the customer. Formatted using E.164 standard. For example, +16135551111.
https://shopify.dev/docs/api/web-pixels-api/standard-events/checkout_completed
Do you think I need to alter your Customer Event Pixel code to place a country code before the phone number?
Thank you again,
Hello Austin, nice find, in that case we need to do two things, first check if the value contains a plus, if no, then add one.
Hello! I would like to handle the Merchant Center through the Google & Youtube official app. Which lines of code do I have to remove in order to delete merchant center settings from your code?
Everything, don’t use any of my coding.
So I cannot use your code at all? Even the datalayers?
I don’t see the point of using my code if you are using the google and youtube app. However if you know what you are doing, yes you can use parts of the code.
Dear Emmnuel, I use your code and my Merchant data source is the Google app and Shopify’s YT, is that why I don’t have Purchase tracking? Because all the others are working and I left your code in full
No, the Google and youtube app will not cause the purchase event to stop working. Most likely there is something on your account blocking the purchase event. I recommend checking the troubleshoot steps in this guide at the bottom of the article.
Hello,
We had changes on December 21, 2024, what are they?
Removed mention of upgrade files.
Hi Emmanuel. Thank you so much for the tutorial. I set it up tonight and look forward to seeing the results. I already had entered the Tag Manager script in theme.liquid. Now that I added the Tag Manager pixel, should I delete that code?
There is no need to add the GTM script in the theme, just the customer event section.
I understand, but I already added it before I followed your tutorial. Do I need to remove it, or is it OK to leave the script where it is? Thank you!
You may expect to see weird behaviors. I recommend you test with and without.
A great professional, I had some doubts about the installation of the pixel, I’m from Brazil and I don’t understand much in English. For the pixel installation method “Shopify Pixel” if I want it to mark the events of “initiate_checkout” “add_to_cart” I need to install “Google Tag” in the theme of the site “theme.liquid”. I will be very grateful if you can answer my question. thanks
If you want to change the event names, make sure to update them in GTM and in the code. And rework how GTM sends the signal. So you will need to do a lot of editing and changing.
if i just create the events i mentioned above and don’t install anything on the site, can it work? do you have a video on your channel showing how to configure these events?
I recommend you check the documentation, and test if what you want to do works.
Out of the box my code works correctly.
I don’t want to change the name of the events, I just want it to mark the events in my google manager. Does this tutorial you taught work for this too?
I recommend you check the documentation, and test if what you want to do works.
Out of the box my code works correctly.
Hello! Thank you very much for all the clarifications.
I would like to ask a question, since I am going to implement automatic discounts from Merchat Center. It asks for valid cart prices in an item: What is required?
Valid cart conversions must have at least one item corresponding to a product with a valid CPV
The conversion must have the event type “purchase” for cart data to be sent
Tip: Check if item.price is available in your cart data
Note: We recommend that you use GA4 to configure conversions with cart data if you are already using or plan to use this same platform for conversions in Google Ads. You can also create a secondary conversion action in Google Ads to provide purchase conversions with cart data for automatic discounts. At the moment, it is not possible to use Floodlight conversion tracking. Can you tell me if this code includes it, or how I can solve it?
Cart data is included, yes.
Thank you for your work, it is very useful.
I saw that in the link the file is V2.023, but the downloaded file is V2.002
There are two files in the zip, the json file from 17 nov 2024 and the script file from 21 oct 2024. These are the latest.
When I finished all the settings and published it, Google TagManager prompted that other domains that need to be configured were detected. Do I need to do something? Or just ignore it?
That sounds like it noticed your checkout URL does not match your website URL, that is my guess. I recommend making sure you update your shopify settings to ensure it is all one and the same domain.
Thank you for your reply. Yes, when I checked with tag assistant, when I paid with paypal, it could trigger the conversion code normally, but when I selected more payment methods, my website jumped to xxxxx.com/checkouts/xxxxxxxxxxxxx, and tag assistant showed that no code was triggered. What should I do?
At the moment I have no feedback, as there is little I can do about this. Currently the code itself follows the setup requirements here: https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/gtm-tutorial
Hello, thank you again for all of this.
The Google Ads account seems to be picking up on these conversions now. Their status is “Active” as opposed to “Needs attention” or others.
You mentioned in a previous comment that these events are not possible to test through Google Tag Manager’s Preview. Is this still the case? If so, how could we see if Shopify is pushing the correct values without using Preview? We have a discount code set and can make a test purchase whenever. I’m just not sure where to check if events are triggering and correct values are being passed.
There are plugins for browsers that you can test, just search shopify pixel data layer chrome extension, but they are all un-reliable. They don’t work 100% of the time.
I tried checking through the Console if the correct data/values are being pushed. I’m not seeing them there, does this mean I didn’t set up correctly? Even if my google ads conversions do detect/is active?
Pixels are run in sandbox mode, which means you can not view the data using traditional tools. Shopify does this for privacy reasons. There are tools out there but they are not 100%
Thank you for all of this.
As a follow up, I realized that GA4 isn’t getting the Items viewed and the Items added to cart data. Is there another code I’m missing for these to be populated in GA4?
There is no additional code, it should all work correctly. It does take 2 days.
Emmanuel, thanks for this in depth guide. I have gone through the tutorial a few times and I am struggling to get my converion actions to fire in Google Ads. My GA4 is detecting information, however it has been about 2 days and all of my conversion actions are “inactive”. GA4 did not pick up my Purchase event when I made a test purchase and landed on the “Thank You” page. Any ideas?
I have never encountered whree GA4 is working and Google Ads is not, that seems to signal the account id, and or conversion label is incorrect. Also double check the troubleshoot section on this page.
Thanks for the response. I have double checked my labels, conversion IDs, and the measurement ID is correct. I noticed also that the “begin_checkout” event is not being picked up in analytics either. However it can see that the checkout page was visitied. It is entirely possible that I am glossing over something, but I have gone over it many times.
Try installing the google and youtube app, see if this works. If this also doesn’t work, than that means something in your account is blocking pixels and or google.
I have replaced the “checkout_started” code with the code below and it seems to be working and tracking information. Is there anything in the original code that would prevent it from tracking in analytics? Perhaps “window.dataLayer.push({“?
analytics.subscribe(‘checkout_started’, (event) => {
console.log(‘custom event’, event)
window.dataLayer.push({
‘event’: ‘begin_checkout’,
‘currency’: event.data.checkout.currencyCode,
’email’:event.data.checkout.email,
‘value’: event.data.checkout.totalPrice.amount,
‘lineItems’: event.data.checkout.lineItems,
‘fired_from’: ‘custom_pixel’
});
});
Edit: The parameters are not visible such as the value, currency, etc.
The only extra parameter you added is fired_from, so it’s possible that works in your case. From 100 installs I have done, the clients I manage, don’t have any issues, but I do know merchants that try to install it themselves, tend to sometimes have issues. But unfortunatley have not discovered why.
I would like to provide an update. I made a few script changes, and then reverted back to the original code as provided. Now everything seems to be working as it should, including purchases and beginning checkouts. I am a bit frustrated as there seems to be no rhyme or reason as to why it is now all working, but it is. Since ALL events are reporting in GA4, I will give Google Ads a bit of time to catch up. I am at a bit of a loss as to what is happening, but hopefully Ads will begin to detect activity.
I know, it’s pretty bad how inconsistent Shopify pixels are.
I arranged a meeting with Google Ads support and just got off the phone with them. The support person said that it’s only possible through the app, and when I showed them the code and working tracking in GA4, they still insisted that it is only possible through the app to track conversions. I know this is not true, so it’s quite disappointing that even Google themselves(or at least the support person) are not knowledgeable on this implmentation.
Ofcourse they will say that 🙂 They need to upsell there own products.
Thanks for all of your help. I have one more question. In Google Ads, I have an old Google tag connected to the account under “Data Manager” that was created when I initally used the Shopify Google and Youtube App. I have since deleted this tag, however it is still connected. Correct me if I am wrong, but perhaps Google Ads is only looking for data from this tag? Would it be worth trying to remove this tags connection to Google Ads, and instead connecting my GA4 “Page View” tag? I cannot delete the old tag’s connection to GoogleAds without assigning another one to the data stream.
It’s worth testing out, but I have not seen this being the case for a solution when there is no tracking.
Hi Emmanuel. Thanks again for the code and for promptly replying. I re-configured my setup and have seccessfully began receiving data in Google Ads. I am not sure what the issue was, but I started with a new property, container, and set up new conversion goals. I would like to inform you that some of the event names for some of the GTM triggers do not match the event names in the code/ecommerce event names as defined by Google. Unfortunately I did not take detailed notes, but there are some discrepancies for page views (which I think you are aware of), view_collection/view_item_list, search_submitted/search, and I added “search” to the “FeedArmy Events” trigger. I discovered these discrepancies after some of my conversion actions were not firing. Let me know if I am mistaken.
The feedarmy events, only track valid event names for GA4, I did not include events that are incorrect. However, view collection for example should be correct, I will re-check the values, thank you for highlighting this!
After checking again, I see that in the .json I see that the event name value “view_collection” is assigned to the trigger named “”feedarmy_view_collection”. However, the event name in the code for “collection_viewed” is “view_item_list”. Don’t the values in the trigger’s “event_name” field need to match the “event” field in the code? I may be mistaken so please correct me if I am wrong.
The correct value in the code is view_item_list, and the event in GTM is also view_item_list, it is correct.
If you see feedarmy_view_collection, that is legacy coding from V1.07, maybe best that you complete import the full version, and reset the conversion action values in GTM, as you might have other outdated setups.
I have downloaded the latest version of the code/.json file just to confirm. What I found is included in the image below. I also created a test container and re-imported the template just to be sure. The trigger “Event name” does not match the event: “xxxx” defined in the code for view the collection, search, and page view actions.
https://postimg.cc/9RX41SQm
That is very strange, thank you for seeing this in the json file, I will go ahead and edit this manually and test on a new container. I appreciate the effort in helping identify the issue, much appreciated!
Yes of course, just wanted to bring that to your attention so that it could be updated for new users. After all, bugs/mistakes are to be expected. Either way, I have since switched to the Google and YouTube app since Google told me that they no longer support/troubleshoot Shopify pixels. Well, their app is tracking less conversions than the code! 😂
My pleasure, and thank you. It’s interesting to hear the google and youtube app is tracking less conversions.
After checking, search was missing. Thank you for reporting the issue.
Friends, I have the same problem, the Summary metrics don’t appear, is it a bug in the ADS or is it related to consent?
Check the troubleshoot guide in my article, and consider testing other types of tracking to see if this also fails. If it doesn’t work, that indicates something in Shopify is blocking it.
Hi! Could you explain exactly what the advantage is of installing via GTM compared to just using the Pixel? With the Pixel I also get customer data etc., don’t I? What is the difference here with enhanced conversions? In my opinion, that is not very clear. Thank you very much!
The two codes I have, 1 direct, 1 via GTM. The direct one does not work with enhanced conversions. GTM does work.
Also via GTM, I am able to include GA4, Remarketing. So 1 code for everything.
In your pixel code I find the code “{‘allow_enhanced_conversions’:true})”.
This gives the impression that enhanced conversions are being transmitted. Things like zip code and email are also transmitted to Google with the pixel.
So what exactly is the difference in the information between the pixel and integration with the GTM?
The GTM integration works for enhanced conversions, the old first iteration of my efforts, non GTM, don’t work with enhanced tracking. That is the difference. I left the code available for merchants to use it, in cases they don’t need enhanced tracking.
Hi, I added the code following video instruction. For 2 website and 2 google ads/tags. I uploaded full script.
However, both account stated that conversions are inactive, not any active. I waited for more than 1 day, checked website still see gtm but troubleshoot via gg ads, it didnt have. The ads campaign are running now and many traffic, conversion in web. Please help
That seems to signal, either the thank you and order page are not published (check the article troubleshooter) or there is an app such as an upsell app, these tend to block pixels. If that doesn’t work, check if all pixels are blocked, if yes, then something is causing an issue.
Hi Emmanuel,
After 3 days, the “Inactive” has gone.
However the Google Tag Manager found issues that “Some of your pages are not tagged”
As the result, GTM recorded no conversion even I have many.
When I checked Tag Assistant plugin, it shows that GTM was installed, but when check Tag Assistant website of Google, it said that “Google Tag: GTM-xxx not found”
Everything in shopify is set up well, published thank you and order status page, the pixel connected. There is no code in the theme files.
In GTM, just created new GTM and upload full version then only change (update ad id and conversion label) for Purchase, Begin Checkout and ATC tag
Yes, pixels will not be detectable using tools, that is because Shopify blocks this for privacy reasons. While there are tools out there, non are 100% reliable, so checking for issues is extremely difficult as a result. My recommendation, if the coding does not work, consider using the google and youtube app.
Pixels are known not to always work, and I do not know why. Nor does Shopify.
You are right! Everything started working in two days and not 2 hours as Google promises. Now can I disconnect the ADS and GA4 account from Shopify and everything will be fine? Should I also disconnect the “Google Ads Remarketing Tracking Created by FeedArmy V1.02″ from the Pixels and remove the old Google Ads Remarketing Tag By FeedArmy Version 2.17 START” code? Thank you for your attention as always.
Yes, once the new tracking is verified as working, you can disable the old tracking.
After implementing everything. I want to sent product type & business vertical parameters with remarketing tag. Is it possible?
If yes how can I do it?
Business vertical is already supported. Product type could be added, I will need to double check.
Hello friend, thank you for your work!
I used the file “Google Tag Manager Import Container – Full Import.json” to configure GTM (new account), installed Cookiebot in GTM and set the TAGs to “No additional consent required” but in the ADS report no TAGs are being marked. Did I do something wrong?
When you have installed everything correctly, wait 1 to 2 full days, then it should work. If it doesn’t work, check the troubleshooting at the bottom of this article.
Can we rename the vent name purchase to something else like purchase_gtm, because I already have builtin purchase event firing on purchase and I don’t want my GTM to fire on that event?
You can, just know that GA4 is reliant on the purchase event name value. So it will no longer work.
Hi Emmanuel, for the remarketing pixel, is it better to set it up through GTM or directly on the site, OR could we just leverage Google Analytics for any remarketing campaigns?
Technically, no difference, but I like to avoid double coding for no reason. Hence why it is now available all in 1 setup.
Hello, I want to thank you once again for your effort, I’m actually following your store and I really like the idea. After importing the *.json file, a request for “Other domains detected for configuration” appeared in my TAG where it asks to automatically link “decoronline-co.myshopify.com, decoronline.com.br, marketdescontaoz.shop, marketofertaplus.shop” where the first two are mine and the other two redirect to my store, but I’m not the owner.
My pleasure Andre, it’s strange that you get linking suggestions form other domains, it’s possible that for some reason you have tracking code from the other domains on your website? That would be the only reason I can think of this happening.
Hi Emmanuel,
Sorry to comment again, but I see that the variable “feedarmy-new-returning-customer” has changed from a custom Javascript to a Data Layer Variable.
However, upon review of the Pixel Code, I don’t manage to find the data layer variable name it refers to (shopifyPixelData.new_customer).
Can you please confirm that despite that this is indeed correct?.
Again, thank you for your awesome work,
Jose
Currently new and returning customer tracking is not yet available. Yes, the change is correct, as I was testing things out. But is disabled in V2 due to it not working.
Great, thank you very much for the clarification!
My pleasure
Hi Emmanuel!
THank you for your great work.
If we use this script, should we then disconnect the one you previously had for remarketing?.
And, I believe that in the upgrade 1.8 to 2.0 json file, the remarketing tag is mssing.
Again, thank you for all the great work and support.
Kind regards,
Jose
Hello Jose, yes, sorry about the upgrade file, this is now updated. V2.021
Once you installed the new version, yes you can delete the old remarketing setup.
Ok, great! Then we will install this one and delete the old remarketing pixel setup. Thanks again!
My Pleasure.
Hello, thank you so much !
I have uploaded the upgrade file to GTM since version 1.8, but it seems to me that it does not contain the tag for remarketing, right?
Is this normal?
Also, if I had installed the shopify remarketing pixel that you provided with the old method, what should I do with this pixel? Delete it?
Thanks in advance for your help!
Have a nice day 🙂
Hello Remi, I have updated the upgrade file.
Regarding the other code, once you have verified the new one is installed, yes, you can remove the old one.
Hi Emmanuel!
Thanks for your work!
I have 2 more questions:
Thank you and best regards
1) Not tested, I doubt that works.
If you want trakcing to work, we must use custom events, so no alternative.
2) GTM, allows us to track enhanced conversions, re-use data for other platforms, such as remarketing, etc.
Thanks for your answer!
I would like to come back to my first question, if that’s OK.
Wouldn’t it be possible to place the part with the GTM tag directly in the template and the rest of your code under “custom events” as you described?
Generally, most instructions on the web recommend inserting the GTM code directly after the section of the source code. This has the advantage that you can also use the GTM debug mode and the “Google Analytics Average Engagement Time Per Session” should be displayed.
Or why do you do all of this under “custom events”? Doesn’t splitting up the code make sense in your opinion?
Many thanks and best regards
I recommend you test it out, I don’t see the need for it to be in the template, and I don’t think you will be able to see any data regardless, as it is the pixels that are blocked.
Most instructions you read, are most likely still based on the old techniques.
For me, it needs to be in the custom events, so that it can work. But again, give a try, let me know, how your experiment goes, I would love to know what solutions you come up with.