In November 2024, GA4's enhanced measurement quietly stopped tracking tel: and mailto: link clicks. Here's a lightweight fix that takes less than ten minutes to implement — no Google Tag Manager required.
The problem
GA4's enhanced measurement feature used to capture clicks on phone and email links automatically. That stopped working in November 2024. The natural workaround — Google Tag Manager — can't reliably access these link clicks on Shopify either, because Shopify's custom pixel sandbox restricts what GTM can see. There is no third-party app that solves this specific problem without bundling it into a paid tracking suite you probably don't need.
The solution
A small JavaScript snippet added directly to your Shopify theme, outside the checkout sandbox, calls gtag natively and sends named events straight to GA4 whenever someone clicks a phone or email link. No middleware, no extra dependencies.
Before you start
Make sure the following are already in place:
- GA4 already installed on the Shopify store via a gtag snippet in theme.liquid or through the Google & YouTube app
- Phone number coded as a tel: link and email coded as a mailto: link on the site
- Access to the Shopify admin and the theme code editor
Step-by-step implementation
Step 1: Duplicate your theme
Before touching any code, create a backup. In Shopify admin go to Online Store > Themes, click the three dots next to your active theme and select Duplicate. If anything goes wrong, you can restore from this copy instantly.
Step 2: Open theme.liquid
Navigate to:
Online Store > Themes > Edit code > Layout > theme.liquid
This is the master template file that wraps every page on your store.
Step 3: Add the tracking script
Find the closing </body> tag at the bottom of the file and paste the following snippet directly above it. Then click Save.
<script>
document.addEventListener('click', function(e) {
var link = e.target.closest('a');
if (!link) return;
if (link.href.startsWith('tel:')) {
gtag('event', 'phone_click', {
'link_url': link.href
});
}
if (link.href.startsWith('mailto:')) {
gtag('event', 'email_click', {
'link_url': link.href
});
}
});
</script>The script listens for any click on the page. When a click lands on an anchor tag, it checks whether the link is a phone number or email address and fires the appropriate named event to GA4, including the link URL as a parameter.
Step 4: Verify with DebugView
Install the Google Analytics Debugger Chrome extension and activate it. Open your Shopify store in the same browser, click the phone number and email links, then go to GA4 > Admin > DebugView. You should see phone_click and email_click events appearing within a few seconds. If they appear, the snippet is working correctly.
Step 5: Mark as key events in GA4
Wait 24–48 hours for the events to appear in GA4 > Admin > Events. Once listed, toggle Mark as Key Event on for both phone_click and email_click. Key events are GA4's equivalent of conversions — they'll now surface in your reports and be available for import into Google Ads.
Step 6: Import into Google Ads
Once marked as key events in GA4, both phone_click and email_click can be imported directly into Google Ads as conversion actions via Goals > Conversions > New conversion action > Import > Google Analytics 4 properties. This allows your campaigns to optimise towards real contact intent signals from your Shopify store.
Important note
| This script lives inside theme.liquid, which means it will be lost if you switch themes or if a developer overwrites the file during an update. Make a habit of checking the script is still present after any theme changes. |

