Skip to content
Adrythm

ReferenceTracking error

Config command out of order

Tag Diagnostics reports that event commands run before the Google tag's config command, so events can be routed unexpectedly. Open the page source and find the first gtag call. If an event call comes first, move the config code so it sits right after the opening head tag, then publish the change and check the diagnostic again.

At a glance

Where it shows
The Diagnostics tab in the Google tag settings.
What stops
No ad stops. Events that run first can land in the wrong place, so the numbers look right and are not.
How serious
A diagnostic, not a penalty. The cost is measurement you cannot trust until the order is fixed.

What it means

The config command gives the Google tag its account and its settings. Event commands ask it to record something, such as a page view or a conversion. When an event runs first, the tag has no settings yet to apply to it, which is what Google means by unexpected event routing.

The message describes the order of calls in the page, not whether the tag is installed. The Tag Manager workspace can look correct while a second script on the page runs an event ahead of the config call, so the check is the page source.

What actually triggers it

  1. A second script that sends an event first

    A conversion script, a form plugin or a builder's own code placed higher in the page than the Google tag runs its event before the config call. Find the first gtag call in the page source. If it is an event, the order is the problem.

  2. A builder's own gtag function on the same data layer

    Not on Google's help page

    In one real site, a website builder shipped its own gtag() function on the page's data layer and sent its own page view and click events. A builder script like that can send events before the site's own config call runs, so read the builder's code in the page source as well as the Google tag.

  3. The config code moved lower in a template edit

    The config code belongs right after the opening head tag on every page. A template change that moves it below the first event call puts the events ahead of it, and only the edited pages show the message.

  4. A site run from Tag Manager alone, with no config call to find

    Not on Google's help page

    A Google tag set up inside a Tag Manager container never writes a config command into the page. On the 16 container-only pages read on 2026-11-21, the data layer held no config call at all, so a page source search finds nothing to put first. On such a site, any gtag event you do find is code outside the container, and that script is where to look.

  5. A data layer message mistaken for an event command

    Not on Google's help page

    A plain message pushed into the data layer, such as a web vitals reading or a page's own page_view entry, is not a gtag command and is not what this message counts. On one managed site, web vitals entries reached the data layer 1.7 to 1.8 seconds before the container loaded, with no gtag event anywhere. Moving them changes nothing for this diagnostic.

Worked examples

Flagged
The page head holds a builder's script that runs gtag('event', 'page_view') near the top, and the site's own gtag('js') and gtag('config') lines sit further down.
Passes
The gtag('js') and gtag('config') lines move to the top of the head, and the builder's event call stays where it was, now below them.

The config call now runs first, so the event takes the tag's settings instead of arriving before there are any.

Flagged
A site loads only a Tag Manager container. Someone searches the page source for gtag('config', finds nothing, and adds a hard-coded config snippet to the head.
Passes
The hard-coded snippet is removed. The search turns up one gtag('event' call left in a form plugin, and that call is replaced with a Tag Manager tag.

A container-only site has no config line to move. The stray event call outside the container was the only command that could run out of order.

Fix it in this order

  1. Open the page in a browser, view the page source, and find every gtag call. Note which one comes first.
  2. If the source is hard to follow, open the browser console on a fresh load, type dataLayer and press Enter. The entries are listed in the order the page sent them. Look for the first entry whose first item is config, and for any entry above it whose first item is event.
  3. If an event call comes before the config call, move the config code so it sits immediately after the opening head tag. Move the event call below it only if the config code cannot move.
  4. Make the same change in the site template or the container, so every page gets it, not only the page you checked.
  5. Create a version of the container and publish it, or deploy the site change, then check the status again in Tag Diagnostics.

Load the same page in Tag Assistant to confirm the config call now runs before any event on a fresh page load.

Lead and call tracking is one of the things we sell, and it goes in before any ad budget is spent. A status like “Config command out of order” is the kind of problem we fix as part of it.

Often confused with

  • Missing gtag config command

    The config code is not on the page at all, so automatic events may not be measured. This message means the code is there but runs after an event. The fix for a missing config is to add it, not to move it.

  • Missing Google tags

    Event tags in the container have no matching Google tag. That is a container problem, so check the container's tags before the page source.

What 20 pages on five managed sites showed, read 2026-11-21

On 2026-11-21 Adrythm loaded 20 pages on the five websites it runs for itself and its clients, the home page and three pages picked at random from each sitemap, in Chromium as a phone. A script recorded every entry pushed into the data layer from the first millisecond, in order, and the page was scrolled once so containers that wait for a scroll loaded too. No business is named.

No page sent a gtag event before its config call. Not one of the 20 pages showed the order this message warns about.

Four sites ran their Google tags from Tag Manager only, and their 16 pages held no config call in the data layer at all. The first entries were the container's own start, a consent default, or the site's own messages.

One site also had a hard-coded Google tag snippet beside its container. On its four pages the js call and both config calls, one for Analytics and one for Google Ads, ran within a millisecond of each other, 62 to 127 milliseconds after the page began. Its container started at about 2.4 to 2.5 seconds.

One site pushed web vitals entries at 1.3 to 1.5 seconds, before its container loaded at 3.0 to 3.2 seconds. They are data layer messages, not gtag commands, so they are not this diagnostic.

Which case is yours

If the page source holds a gtag config line and a gtag event line sits above it, move the config line up. That is the case Google describes.

If the page source holds no config line, the Google tag lives in a Tag Manager container. Search the source for any gtag event call outside the container, from a plugin, a builder or an old snippet, and move that work into the container.

If the only entries ahead of the container are plain data layer messages, they are not the cause. Leave them, and keep looking for a gtag event call in the page source.

Still have a question this page did not answer?

Ask it on a call. Thirty minutes, a straight answer, and no follow-up sequence if you decide not to work with us.