Skip to content
FunnelGuard

Fix guide by FunnelsGuard

CTA opens in a new tab and loses UTMs: how to find and fix it

CNV-098Medium impactDetectedBy FunnelGuardPublished Updated
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.

Where the campaign data disappears
  1. Ad clickURL has utm_source and gclid
  2. Landing pageTags present in the address bar
  3. CTA opens new tabLink URL has no query string
  4. Form or checkoutNo campaign data on the page
  5. ConversionCredited to direct

The visitor arrives tagged, but the new tab opens without the parameters.

Conversions by reported sourceExample numbers
Conversions by reported source (example)Reported as the campaign (broken): 20 conversions; Reported as direct (broken): 80 conversions; Reported as the campaign (fixed): 95 conversions03673208095Reported as the campa…Reported as direct (b…Reported as the campa…conversions

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

Test it by hand in two minutes
  1. Build a tagged URL

    Add ?utm_source=test&utm_medium=cpc&utm_campaign=newtab&gclid=test123 to your landing page address and open it.

  2. Click the CTA

    Click the button or link that opens a new tab.

  3. 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.

  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 collect request and its dl and gclid values.

  5. Inspect the link

    Right-click the CTA, choose Inspect and look for target="_blank" and the href. 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.

Pass UTMs and click IDs to links that open a new tabjavascript
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();
});
Fix it on your platform
  1. 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.

  2. 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.

If a script uses window.open()javascript
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');
}
CTA link before and after

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

Confirmation checks
  • 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

Prevention habits
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: UTM persistence.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.