Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards

gTag not defined issue

Avatar

Level 1

I have the same gtag script that runs in English and French version. gtag works in French page, while it doesn't work in English.

gtag not defined, conversion is not recorded.

Note: Gtag is fired in one rule, Conversion is fired on a specific page using another rule. This gtag rule is not changed recently. Both En and Fr page were working fine, and not sure why it has suddenly stopped working. Any insights would be greatly appreciated.

gTag snippet - Copy.png

4 Replies

Avatar

Community Advisor

Hi @RajeshMa4 

This kind of issue usually comes down to either timing or scoping differences between the pages — even if both share the same script and rules.

Here are a few things worth checking -

  1. Order of Execution
    Make sure the gtag library is actually loaded before any rules that call gtag() fire. On the English page, it’s possible the rule firing the conversion is running before the gtag script finishes loading.

  2. Script Blocking or Errors
    Check the browser console on the English page. Are there any 404s or blocked script errors for gtag.js? A CSP policy or a tag sequencing issue might be silently breaking it.

  3. Page Variants or DOM Differences
    Sometimes the way the tag is injected (especially if it’s based on a selector or condition) might behave differently if the DOM is slightly different on the English version.

  4. Double-Check Rule Conditions
    It’s worth rechecking both rules (gtag load and conversion fire) to ensure:

    • The gtag rule is not accidentally scoped to only /fr/ pages.

    • No recent change (URL pattern, rule condition, etc.) unintentionally excluded the English variant.


Also, In DevTools - go to - Network tab, look for gtag/js loading and the actual hit request to Google. If nothing fires on English but does on French, that confirms the script is missing or misfiring.

Let me know if that works.

Avatar

Community Advisor

Hi @RajeshMa4 

Since you're defining the gtag and push in your script above, it should work if the rule fires before the conversion.

i would enable debugging and filter for "fired" in the console to make sure the conversion rule fires after the script that defines gtag is loaded.

what are your rule events and conditions? Are you using a specific order to make sure one fire before the other (assuming that the events and conditions when they fire are identical)?

by default, rules have an order of 50 and multiple rules with the same event and order might be competing against each other.

Cheers from Switzerland!


Avatar

Community Advisor and Adobe Champion

Like @bjoern__koth , I agree... you are manually defining the gtag, so you should be fine... there should be no issue with order of operation here, since the entirety of the code is right here (check for data layer, set it up if not already there, configure, etc)

 

I also suspect that the issue might sit with your rule conditions... 

 

 

I too suggest using the Satellite Debugger to try and see if the rule conditions are being met, and if there is any errors being thrown.

 

// Turn on Debugger
_stellite.setDebug(true);

// Turn off Debugger
_stellite.setDebug(false);

Avatar

Community Advisor

Hi @RajeshMa4 , I am aligned with @Jennifer_Dungan . Since you're manually defining gtag in the code block, and not relying on external loading from GTM or gtag.js asynchronously, there should be no race condition in theory. This makes it even more likely that the issue is with Adobe Launch rule conditions or firing logic, not script order. 

 

 

Enable Debugging in Console:

_satellite.setDebug(true);

 

Reload English Page

Watch the console. You should see something like:

SATELLITE: Rule "Your GTAG Load Rule Name" fired.

 

Check If You See This Rule Name Fire

If it doesn't fire, here's what to check:

 

Does the GTAG rule have page path conditions?

  • It might be restricted to /fr/ or exclude /en/
  • Double-check all rule conditions, especially:
    • Path or URL contains
    • Page URL or Host filters
    • Language-based Data Element usage

Check rule firing events

  • Is the rule firing on DOM Ready or Page Load?
  • If your conversion fires on Window Loaded but gtag is fired on DOM Ready, they could get misaligned.

Check if gtag is defined globally

Open your browser console and run:

console.log(typeof gtag); // Should say "function"
console.log(window.gtag); // Should show a function definition

If it's undefined, the rule isn’t firing.

 

Fix your Adobe Launch rule conditions to make sure the gtag load rule runs on all pages, especially English ones.
You can also split the gtag loader into a global rule that always runs, and then have separate rules for conversions.