Shopify9 min read2 views

Shopify GA4 contact info tracking with GTM

Set up Shopify add_contact_info tracking through Customer events and GTM, with the event payload, GA4 parameters and test checks.

Watch on YouTube

Jump to the code

The short answer

Use Shopify checkout_contact_info_submitted as the source and send add_contact_info as your own GA4 event. Google's recommended-event listsupport.google.com has no add_contact_info event. This guide is for store owners and implementers maintaining a custom pixel, with a development store available for testing.

  • Use checkout_contact_info_submitted as the Shopify sourceshopify.dev.
  • Set the GTM trigger to gtm_custom_event in this example.
  • If an app already sends add_contact_info, inspect it before adding a second sender.
  • Steps and settings checked against Shopify and Google documentation on 25 October 2026.

Ask an assistant

ChatGPTClaudePerplexity

FREE CALL

30 MIN

Meta stopped counting your leads? Get them counted again.

  1. Pick a time
  2. Check your Meta account with Hassan
  3. See what to do next

On a free 30-minute call, Hassan checks your Meta account with you and shows you what to do next.

Book my free recovery callFree 30-minute call with Hassan.

Not ready to talk? Run a free check

How do I track Shopify contact submissions in GA4?

Start with a checkout that has Checkout Extensibility enabled; Shopify limits this event to those checkoutsshopify.dev. Keep the contact-step test separate from begin_checkout and add_payment_info.

The video shows the older configuration and testing method; the written steps below use the current Google tag and Shopify Pixel Helper workflow.

Use a development store, a dedicated GTM test container and a test GA4 web stream. Shopify suggests testing pixels on a dev storehelp.shopify.com before adding them to a live store. Use page_view setup when checking the rest of this tracking setup.

What do I need before adding a custom pixel?

Have access to Shopify Customer events, your GTM test container and your test GA4 web stream. Shopify warns that overlapping pixels can count events twicehelp.shopify.com; record which app or script already sends add_contact_info.

1. Check the existing sender

  1. Before changing anything, inspect the installed apps.
  2. Inspect the custom pixels.

Done when you can name the intended sender of add_contact_info and the test stream that will receive it.

How do I add the custom pixel in Shopify?

Create or extend one custom pixel under Settings > Customer events, following Shopify's setup instructionshelp.shopify.com.

2. Create the pixel in your development store

  1. Give the pixel a clear name.
  2. Choose Add pixel.
  3. Review Customer privacy.
  4. Select permissions and data-sale settings that match the store's consent plan, using Shopify's settings guidehelp.shopify.com.

Done when the editor is open and those choices are recorded.

What code sends Shopify contact submissions to GTM?

Keep the GTM loader and event subscription in the same custom pixel. Shopify's GTM tutorialhelp.shopify.com uses the head loader with its HTML script tags removed.

3. Add the loader and subscription

  1. Add the code below to the custom pixel.
  2. Replace GTM-EXAMPLE with the ID of a test container that only your development store loads.
  3. If this pixel already loads that container, append only the subscription and its logging helper.
  4. Save the code in the development store.

A callback is the function inside analytics.subscribe that runs when Shopify emits the named event.

add_contact_info.js111 lines
// Initialize the dataLayerwindow.dataLayer = window.dataLayer || [];(function (w, d, s, l, i) {  w[l] = w[l] || [];  w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });  var f = d.getElementsByTagName(s)[0],    j = d.createElement(s),    dl = l != "dataLayer" ? "&l=" + l : "";  j.async = true;  j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;  f.parentNode.insertBefore(j, f);})(window, document, "script", "dataLayer", "GTM-EXAMPLE");// Function to log event to console with enhanced visibilityfunction logEventToConsole_add_contact_info(dataLayerEvent) {  const customStyle01 =    "color: #FFFF00; background-color: #000000; font-size: 10px; font-weight: bold; padding: 2px 0;";  console.log("%cDataLayer Event: add_contact_info ", customStyle01, dataLayerEvent);}

93 more lines of JavaScript

  • Copy and download
  • Emailed to you

Unlock this snippet

Two details, and the full code is yours

No account needed. Unlock once and every snippet on the blog opens.

We email you a copy.

Done when the saved code contains your test container ID and the checkout_contact_info_submitted subscription.

Shopify's payload referenceshopify.dev allows a null variant or ID. This snippet skips item details without both a real variant ID and product ID. It totals every source line first, so omitted details do not reduce the event value. Missing line amounts still raise an error. This custom event therefore carries incomplete item details whenever a line is omitted.

Done when local synthetic checks with a valid line plus a null-variant line, a null variant ID and a null product ID keep add_contact_info and its full source-line value. Only entries with real variant and product IDs remain; none has a blank or invented ID. Test an all-missing-ID payload too: the event value remains, the item array is empty and the diagnostic is visible.

Read the event payload before choosing the GTM variables. Shopify's referenceshopify.dev defines this event's fields; the table shows how this example maps them.

currency

Data Layer Variable name
ecommerce.currency
Shopify field or calculation
data.checkout.currencyCode

value

Data Layer Variable name
ecommerce.value
Shopify field or calculation
Sum of every source finalLinePrice.amount, before item filtering

items

Data Layer Variable name
ecommerce.items
Shopify field or calculation
Checkout lines with real variant and product IDs, mapped to GA4 items

page_location

Data Layer Variable name
page_data.url
Shopify field or calculation
context.document.location.href

page_title

Data Layer Variable name
page_data.page_title
Shopify field or calculation
context.document.title

page_referrer

Data Layer Variable name
page_data.referrer
Shopify field or calculation
context.document.referrer
Use these exact paths with the snippet in this guide.

This snippet uses finalLinePrice.amount / quantity for each unit price. Shopify defines finalLinePriceshopify.dev as the line total after line-level discounts, available with Checkout Extensibility. This example assumes those totals exclude tax and include the discounts you need; otherwise stop and adapt the amount mapping before sending events.

For this custom event, the example uses an item-based value consistent with the other checkout guides. Missing line amounts stop the snippet with a visible error instead of being treated as zero.

The page fields use Shopify event context. Google configuration referencedevelopers.google.com defines page_location, page_title and page_referrer; the snippet leaves browser history alone.

How do I check that Shopify sends checkout_contact_info_submitted?

Use Shopify Pixel Helper to check checkout_contact_info_submitted before troubleshooting GA4. Shopify's testing guidehelp.shopify.com explains how to inspect the source event and errors.

4. Check the Shopify event

  1. On the development store, connect the saved pixel.
  2. Choose Test.
  3. Submit the contact form during checkout.
  4. In Pixel Helper, expand the checkout_contact_info_submitted payload and compare the fields in the table.
  5. In the pixel's browser console context, inspect the logged add_contact_info data-layer object.

Done when Pixel Helper shows checkout_contact_info_submitted with a green dot, its data matches that action, and the logged object's event name and mapped values match the Shopify payload.

Which Google tag and trigger does add_contact_info need?

Use the current Google tag for your test web stream. Google's setup guidesupport.google.com describes the Google Analytics destination and the alternate Google tag setup.

5. Confirm the base Google tag

  1. Reuse the intended test stream configuration.
  2. For the alternate setup, choose Google tag and enter its tag ID.
  3. Use the Initialization - All Initialization Events trigger, as described in Google setup guidesupport.google.com.

Keep pageview setup separate from this event tag; follow the Shopify page_view guide if you need manual page context.

Done when the saved tag points to the test stream and initializes before the event tag, and the add_contact_info tag has its own event trigger rather than an All Pages trigger.

Use a Custom Event trigger, which tells GTM when to run the tag. Its Event name must match the pushed event key, as Shopify's GTM instructionshelp.shopify.com explain.

6. Create the event trigger

  1. Create a Custom Event trigger.
  2. Enter gtm_custom_event exactly in Event name, with regular-expression matching off.
  3. Add a Data Layer Variable for datalayer_event_name.
  4. Require that variable to equal add_contact_info, then save the trigger.

This keeps other gtm_custom_event messages from firing the contact tag.

Done when the saved trigger matches the gtm_custom_event key in the snippet.

Which parameters should the add_contact_info tag send?

Create a Data Layer Variable for each path in the mapping table. A variable reads the value from the event object; Shopify's GTM guidehelp.shopify.com describes mapping those values into tag parameters.

7. Map the event parameters

  1. Create a Data Layer Variable for each path in the mapping table.
  2. Use Version 2support.google.com for the nested paths.
  3. Give each variable a clear label, such as DLV - page_data.url.
  4. Enter the exact field path in Data Layer Variable Name, not the display label.

Done when every parameter in the table has a matching variable.

Send add_contact_info with a Google Analytics: GA4 Event tag, following Google's event-tag instructionssupport.google.com.

8. Save the GA4 Event tag

  1. Create a Google Analytics: GA4 Event tag.
  2. Enter the test stream's Measurement ID.
  3. Set Event Name to add_contact_info.
  4. Under Event Parameters, add the table's parameter names, using their Data Layer Variables.
  5. Attach the gtm_custom_event trigger and save the tag.

Done when the saved event name, destination and variable mappings match the table.

Keep items as an array of item objects, not a text string. Use the explicit parameter mappings in this guide without adding a second automatic ecommerce mapping.

How do I test add_contact_info without changing live tracking?

Check the source event and GA4 receipt in the same test session. Google's DebugView guidesupport.google.com lets you inspect received events and their parameters.

Shopify sayshelp.shopify.com Tag Assistant's Troubleshoot tag feature is incompatible with custom pixels. Use Pixel Helper for the source and DebugView for receipt; a console log alone does not show GA4 receipt.

9. Prepare the test tag for DebugView

  1. Open this test GA4 Event tag.
  2. Add debug_mode: true using Google's debug instructionssupport.google.com.
  3. Save the tag.

Done when the saved test tag includes that parameter.

10. Publish the version in the test container

Changes saved in a workspace do not run yet. Google sayssupport.google.com you need to publish workspace changes to make them operational.

  1. Open the test container that only your development store loads.
  2. Select Submit, then choose Publish and Create Version.
  3. Name the version and publish.

Do not publish to a container your live store loads; move the tested setup there through your normal release process.

Done when the test container's Versions list shows your version as published and the pixel code loads that container's ID.

Shopify's Test control opens the pixel for testinghelp.shopify.com. It does not replace the GTM publication step above.

11. Run the event through the test container

  1. Open Test from the connected custom pixel.
  2. Grant the planned analytics consent.
  3. Submit the contact form during checkout.
  4. In Pixel Helper, check that checkout_contact_info_submitted appears without an error.
  5. In the test property, open Admin > Data display > DebugView.
  6. Select your test device and check that add_contact_info appears and the parameters match the source values.
  7. Repeat with a different product, quantity or page.
  8. Exercise the denied-consent path.
  9. Note both results and whether they match the consent plan.
  10. Remove debug_mode from the finished configuration after testing.

Google sayssupport.google.com setting debug_mode to false does not disable debug mode.

Done when Pixel Helper and DebugView show the results above, your notes record both consent results and whether they match the consent plan, and debug_mode is absent from the saved configuration.

What should I check after this event works?

Compare the begin_checkout guide with the same test journey. Keep the source-event and GA4 receipt notes together so another implementer can repeat the check.

When is this setup the wrong fix?

A second sender, a mismatched trigger or the wrong payload needs a different fix. Check the failing stage before adding tags.

  • Another app already sends the same event: Shopify warnshelp.shopify.com that overlapping pixels can double-count it. Identify the existing sender before adding this one.
  • The trigger uses a friendly label rather than gtm_custom_event: it will not match the snippet's event key. Copy the key into the trigger.
  • Contact details are mapped into GA4 parameters: Google prohibits sending personally identifiable informationsupport.google.com such as email addresses and personal phone numbers. Map only the fields listed here, and review URLs and titles for personal data.

What changed in this guide

  • 25 October 2026: Corrected the add_contact_info mapping, consent settings, Google tag setup and test procedure. Updated the code and completion checks; the video still shows the older method. Made test-container publication mandatory and replaced the repeated intro with the event-specific next step. Corrected nullable item IDs and added synthetic null-case completion checks without reducing event amounts.

Sources

13 sources
  1. 1Shopify source↩
  2. 2recommended-event list↩
  3. 3Shopify suggests testing pixels on a dev store↩
  4. 4Shopify warns that overlapping pixels can count events twice↩
  5. 5Shopify's GTM tutorial↩
  6. 6Google configuration reference↩
  7. 7Google's data-layer guide↩
  8. 8Google's setup guide↩
  9. 9Version 2↩
  10. 10Google's event-tag instructions↩
  11. 11Google's DebugView guide↩
  12. 12Google says↩
  13. 13Google prohibits sending personally identifiable information↩