A conversion can happen before its tracking library finishes loading. A fast checkout redirect, an immediately available confirmation page, or a lead form that submits without a page reload can all produce an event while gtag.js or a Google Tag Manager container is still loading. That does not automatically mean the event is lost. It means the test needs to show whether the event was queued, processed, and sent before the page went away.

For affiliate tracking, the useful question is not simply which script loads first. It is whether the same confirmed conversion reaches the intended destination once, with the correct transaction ID and value, under the timing conditions real visitors encounter. A controlled load-order test separates that question from consent restrictions, navigation timing, and delays in reporting.

Define what counts as an early conversion

Use a conversion that fires from a confirmed outcome, such as a successful test purchase or an accepted lead. Do not substitute a checkout button click for a completed purchase. It may fire earlier, but it changes what you are measuring and can make the setup look more reliable than it is.

Record three points on the timeline: when the application confirms the conversion, when it hands the event to the tracking setup, and when the browser initiates a request for the intended destination. The first two can differ if an application callback waits for another dependency. The third can be absent even when the event is visible in a queue or debugging panel. Use one distinct test transaction ID per run, and keep the same ID if you deliberately replay that run to check for duplicates.

Compare gtag and Tag Manager under the same conditions

Test the direct gtag path

Start with a page where the inline bootstrap creates the data layer and defines the gtag function before your application can call it. In the standard setup, that function adds commands to the queue; the external library does not have to be loaded for the function call itself to succeed. Keep the required destination configuration in place, then delay the external library and trigger the test conversion while it is still loading.

Check that the conversion call enters the queue and that a matching request appears after the library arrives. Inspect the destination and the fields that matter to your programme, such as the transaction ID, value, and currency. If the application calls gtag before the inline function exists, that is a different failure: the event was never queued. Check the console and application log rather than treating a missing request as proof that the library dropped the conversion.

Test the Tag Manager path

Use an equivalent page with the data layer initialised before the application pushes a named conversion event. Include the fields needed by the tag in the same push so the trigger does not depend on a separate update arriving first. Delay the container script, push the event, and then let the container load. A correctly initialised queue can hold the event until the container processes it, but that does not guarantee that the configured trigger matches or that the tag is eligible to fire.

In Tag Manager Preview, look for the exact custom event and inspect the variables as they appeared on that event. A transaction ID visible on a later event does not prove it was available when the conversion trigger ran. Check the browser request separately, and repeat the run without Preview to confirm that the published setup behaves the same way.

Run a small load-order matrix

Use a test destination where possible. Keep the conversion payload, consent state, network conditions, and page flow consistent across both implementations. Run the two paths separately before testing them together; otherwise, one path can send the request while the other gets credit for it in your notes.

  1. Library ready before conversion: Establish that each setup can send the event under normal conditions. If the baseline fails, fix the configuration before interpreting the timing tests.
  2. Queue ready, library pending: Hold back the library or container long enough to produce a conversion first. Keep the page open and check whether the event is sent when the script finishes loading.
  3. Conversion before initialisation: Test the earliest point at which your application can call gtag or push to the data layer. Look for a missing function, an uninitialised queue, or a later script that replaces the original queue instead of reusing it.
  4. Conversion followed by navigation: Repeat the delayed-load case with the real redirect or page transition. Compare it with the page-open run to see whether the event is lost before processing or whether a request starts and is interrupted.
  5. Both implementations present: If production uses direct gtag and Tag Manager together, test that exact setup. Count matching requests, not every Google request on the page. Two requests are only evidence of double sending if they represent the same conversion for the same destination.

Repeat the key cases with a cold cache and a warm cache. A cached script can hide the order on which the bug depends. For navigation tests, preserve the browser network log so the next page does not erase the evidence. Record the order you actually observed; a throttle setting alone does not prove that the conversion beat the script.

Run the load-order comparison first with a known consent state that permits the test tag, then test the production consent sequence separately. Otherwise, a tag held back by consent can look like a queue that failed to drain. A request under denied consent is not necessarily equivalent to a regular conversion request either. Depending on the implementation, a tag may be blocked entirely or may send a limited ping. Use the default denied behaviour tests to check that distinction before marking the run as a timing failure.

Keep the evidence levels separate. An event in the data layer shows that the application handed it off. A fired tag in Preview shows that Tag Manager reached the firing step. A matching network request shows that the browser attempted to send it. None of those observations alone proves that the destination counted the conversion or credited an affiliate. Once you have a matching request, investigate destination processing and attribution separately from browser timing. The difference between batching and reporting latency matters when a request leaves immediately but the conversion appears later.

Use the first failed step to choose the fix

If the event never enters the queue, fix the handoff: initialise the queue before application code can emit a conversion, and make sure later code does not replace it. If the event is queued but the tag never fires, inspect the event name, trigger conditions, destination configuration, and consent state at the time of processing. If it works only when the page stays open, test a reporting point that survives the real checkout flow, such as a stable confirmation page. Where a supported server-side integration is available, use a confirmed order or lead as the source and test deduplication before running it alongside the browser tag.

Keep a regression record with the test transaction ID, consent state, observed load order, request outcome, and eventual destination result. A useful pass criterion is specific: under the production consent and navigation conditions, one confirmed test conversion produces one matching request per intended destination, with the expected transaction ID and value. That gives you evidence to compare after a container publish, checkout redesign, or change to when the site loads its tags.