On this page
What this issue is
UTMs are tags such as utm_source and utm_campaign added to a URL so analytics knows which campaign sent the visitor. Ad platforms add click IDs such as gclid (Google Ads) and fbclid (Meta) for the same job.
This issue happens when your landing page has a button or link that opens in a new tab (target="_blank" or window.open()) and the new tab loads a URL without those parameters. The visitor arrived tagged. The page they land on next is not.
Common causes: the button's URL is typed in without a query string, a script or page builder builds the new-tab URL from a fixed value, or the new tab starts a fresh session where nothing from the first tab is stored.
Why it costs you leads or sales
The visitor still converts, so nothing looks broken. But the form, booking or checkout happens on a page that has no campaign data. Analytics then reports the lead as direct or unassigned, and the ad that paid for the click gets no credit.
That skews decisions. Campaigns look weaker than they are, budgets get cut or moved, and ad platforms receive fewer conversions to learn from. Hidden/lost click IDs can also mean conversions cannot be matched back to the ad click.
- Ad clickURL has utm_source and gclid
- Landing pageTags present in the address bar
- CTA opens new tabLink URL has no query string
- Form or checkoutNo campaign data on the page
- ConversionCredited to direct
The visitor arrives tagged, but the new tab opens without the parameters.
Example: 100 real conversions from one campaign. With the new-tab link broken, most appear as direct. Numbers are illustrative.
How to check if your site has it
Build a tagged URL
Add
?utm_source=test&utm_medium=cpc&utm_campaign=newtab&gclid=test123to your landing page address and open it.Click the CTA
Click the button or link that opens a new tab.
Read the new tab's address bar
If the UTMs and gclid are missing, the parameters were lost. Note that some sites deliberately store them and remove them from the address, so also check step 4.
Check analytics
In GA4 open Reports > Realtime, or use DebugView, and see which source the new tab's session reports. Also look at the Network tab in browser developer tools for the
collectrequest and itsdlandgclidvalues.Inspect the link
Right-click the CTA, choose Inspect and look for
target="_blank"and thehref. Check whether the href has a hard-coded URL or a script handles the click.
How to fix it
There are two reliable approaches. Either append the current page's parameters to the link when it is clicked, or store them on the first page (cookie or storage) so any later page can read them. Often the simplest fix is to stop opening a new tab at all, since a same-tab link keeps the session intact.
document.addEventListener('click', function (e) {
var link = e.target.closest('a[target="_blank"]');
if (!link || !window.location.search) return;
var url = new URL(link.href, window.location.href);
if (url.origin !== window.location.origin) return; // only your own site
var current = new URLSearchParams(window.location.search);
['utm_source','utm_medium','utm_campaign','utm_term','utm_content','gclid','fbclid','msclkid'].forEach(function (key) {
if (current.has(key) && !url.searchParams.has(key)) {
url.searchParams.set(key, current.get(key));
}
});
link.href = url.toString();
});Edit the button
In the block editor select the button, open the link settings and turn off 'Open in new tab', or keep it and add the snippet above through a header/footer plugin or your child theme.
Check plugins
Page builders such as Elementor have an 'Open in new window' option on the button. Turn it off, or confirm the URL field is not a fixed address.
Edit the link in the theme
In Online Store > Themes > Customize, find the button's link setting. Theme buttons often have no new-tab option, so look in the section's Liquid file for
target="_blank"and remove it.Add the script if you need the new tab
Add the snippet to
theme.liquidjust before</body>.
Create a Custom HTML tag
Paste the snippet inside
<script>tags and fire it on All Pages (or the landing pages only).Preview and publish
Use Preview mode with a tagged URL, click the CTA and check the new tab's address bar before publishing.
Change the link setting
Select the button, open Element Settings and untick 'Open in new tab'.
Or add the script
Add the snippet under Site settings > Custom code > Footer code, then publish.
Edit the button link
In the funnel or website builder, select the button, open its link settings and switch off the new-tab option.
Add the script if needed
Paste the snippet in the page's Tracking Code > Footer section for the funnel step.
Edit the link
Select the button, click the link icon and untick 'Open in new tab'.
Custom code
If you need the new tab, add the snippet via Settings > Custom code, placed in the body end, on the relevant pages.
Edit the button
Click the button, open the link settings and turn off 'Open in new window'.
Code injection
Or add the snippet under Settings > Advanced > Code Injection > Footer.
Remove target=_blank
If you do not need a new tab, remove the attribute from the anchor.
Or build the URL with the parameters
Pass
window.location.searchinto the URL you give towindow.open(), or use the snippet above for ordinary links.
function openOffer() {
var target = new URL('/offer', window.location.origin);
target.search = window.location.search; // keep UTMs and click IDs
window.open(target.toString(), '_blank', 'noopener');
}Broken
- Button href is /offer with no query string
- New tab opens with a clean URL
- Session reported as direct
Fixed
- Button keeps utm_* and gclid
- New tab URL matches the landing page tags
- Session reported as the real campaign
How to confirm it's fixed
- Open the landing page with a tagged URL (utm_source, utm_campaign, gclid).
- Click the CTA and confirm the new tab's URL still contains the tags.
- Check GA4 Realtime or DebugView: the session shows the campaign, not direct.
- Repeat on mobile, since some in-app browsers handle new tabs differently.
- Submit a test form in the new tab and check that the lead record carries the source, if your form captures it.
How to prevent it happening again
- Default to same-tab links for conversion buttons unless there is a clear reason.
- Keep one shared script for parameter passing instead of per-button fixes.
- Test with a tagged URL after every theme, plugin or page-builder update.
- Add the new tab's domain to cross-domain tracking if it is a different site.
- Review new landing pages with the manual check above before sending ad traffic.
How FunnelGuard handles this
FunnelGuard detects this today through its UTM persistence check. A robot visitor opens your journey with a marked test URL, follows the CTA step by step and checks whether the campaign parameters are still present on the pages and tracking hits further along the journey.
If a failure shows up, FunnelGuard re-checks from a second region before sending one alert (email, Slack, Teams, WhatsApp, webhook or PagerDuty) with a screenshot and a likely cause. Test traffic is marked with utm_source=funnelguard and fg_test=1, and it never clicks real ads. You can start on the Free plan (1 site, 2 journeys, daily checks, no card) or try a paid plan free for 3 days.
Questions people ask
Why do my UTMs disappear when a link opens in a new tab?
Usually the button's URL is hard-coded without a query string, or a script opens the tab using a fixed address. A new tab does not copy the parameters from the page you came from. You must pass them into the link or store them on the first page.
Does target="_blank" itself remove UTM parameters?
No. The attribute only tells the browser to open the link in a new tab. The loss comes from the link's URL, which does not include the parameters, so the new page loads without them.
Why does my CTA click show up as direct traffic in GA4?
If the page the visitor lands on has no UTMs or gclid, GA4 has no campaign data to read and may label the session direct or unassigned. A new-tab link without the query string is a common cause. A different domain without cross-domain tracking can cause the same result.
How do I keep UTMs when a button opens in a new tab?
Copy the parameters from the current URL into the link's href when it is clicked, or into the URL you give to window.open(). You can also store them in a cookie or session storage on the landing page and read them later. Alternatively, open the link in the same tab.
Is it better to open CTAs in the same tab?
For conversion buttons, usually yes. Same-tab links keep the session and parameters together and avoid confusing visitors with extra tabs. Use a new tab only when you want to keep the original page open, and then pass the parameters through.
How can I test whether my CTA keeps UTMs?
Open your landing page with a tagged URL such as ?utm_source=test&utm_campaign=newtab&gclid=test123, click the CTA and read the new tab's address bar. Then check GA4 Realtime or DebugView for the session source. Repeat it on mobile.
Can FunnelGuard tell me when a new-tab CTA loses UTMs?
Yes. FunnelGuard's UTM persistence check follows your journey with a marked test visit and flags when the campaign parameters do not carry through. You get one alert with a screenshot and a likely cause after a second-region re-check.
Related issues
- CNV-111Ad landing page URL redirects and strips UTMs/gclidFix guide
- CNV-100CTA tracking event missing on clickFix guide
- CNV-109Links with http:// causing redirect hopsFix guide
- CNV-093CTA links to the wrong page (old offer, wrong product)Fix guide
- CNV-110Redirect loop on CTA targetFix guide
- CNV-092Main CTA links to a 404Fix guide