Keap/Infusionsoft Incompatibility with Google Analytics GA4

Keap/Infusionsoft Case # 03023084 (reference this with Keap/Infusionsoft)

This Page Last Updated: June 4, 2023

Status: Software Patched, Pending Testing & Deployment - Estimated resolution by June 9, 2023

Users Affected: All Keap/Infusionsoft users running Google Analytics GA4

Abstract: Google, Apple, and all the other big players have have ended 3rd party tracking cookies, which are no longer usable. Systems like the new Google Analytics GA4 rely on 1st party cookies for tracking. Because of this, GA4 cross-domain tracking (such as a web-user traveling from to their Keap/Infusionsoft shopping cart at requires passing of the GET variable _gl in the URL when moving from one domain to another, for the purposes of maintaining the session, by passing session linking data via that GET variable. That variable must be passed and there must be GA4 JavaScript on the receiving page, or the traffic session breaks.

Steps to Understand & Reproduce the Problem

(I'm using Chrome on a Mac, in Incognito, with NO "privacy" or "ad-blocking" plugins installed which could affect this test)

1) Go to my test/demo website at

2) In the top right, inspect the cart icon (right click it to see the "Inspect" option).

3) As this page is setup with GA4 JavaScript, with cross-domain tracking working correctly, you will see the link to the shopping cart has been automatically appended with the _gl GET var (which passes the session data to the cart page)

4) And if you go back and click that cart icon, you'll actually see that _gl inside of the URL for the shopping cart (the normal and expected behavior).

5) And because the shopping cart has GA4 JavaScript correctly setup with cross-domain tracking working correctly, if you inspect the "Continue Shopping" link, you will see that _gl has been appended there also.

So everything is working as designed. When traffic moves back and forth between the website and the cart, session data is passed, and because of that the user session is maintained. Now, here's the case of things NOT working...

1) Go to and from the top menu, click on the "Gummy Chews" link.

2) If you inspect the "Add to Cart" button on that page, you will see a URL similar to the below URL, with the _gl properly added: productId=4&_gl=1*1k4fwrn*_ga*MTkwMjQ5OTk4Ny4xNjc3NjE1NzYx*_ga_LGLX10VK 7K*MTY4MjI4NTEzMi4xMi4xLjE2ODIyODc5MjUuMC4wLjA.

However, that link is a redirect where there is NO way to install the GA4 JavaScript to that URL to catch the _gl value, so the result is that you get forwarded to the below URL (which has GA4 JavaScript, but the _gl is NOT present), so the session breaks.

Why this is Important

Broken sessions mean a few very bad things...

Incorrect conversion attribution - Traffic source data gets lost, so when you're trying to figure out what traffic source is responsible for a sale, that data has been destroyed. You have no idea where sales are coming from.

Session data gets inflated - Where it should be a single session as a web-user makes a purchase, a new session gets created every time they add an item to the cart.

Bounce rates get inflated - Where Google should see a session from "start" through "sale thank-you page", Google thinks your users are giving up on a broken funnel. All the sales funnel reports inside GA4 are now broken and useless.

Session duration drops - Because the session keeps on getting reset, web-users that should be considered "high-value" based off of their high session duration never get recorded.

Google Ads "quality" gets diminished - Because Google uses all of the things above to calculate how well your ads are matched to the desires of the web-users clicking your ads, ad cost goes up and the number of ads served goes down. (Very bad)

The Solution

On all Keap/Infusionsoft hosted URLs (pages) where for any reason we can NOT install GA4 JavaScript to catch the _gl (as is the case of the above mentioned "add to cart" redirects), simply persist the _gl to the forwarded URL (where there is GA4 JavaScript to read it and properly link the sessions). Using my example above, with the fix deployed, clicking on: productId=4&_gl=1*1k4fwrn*_ga*MTkwMjQ5OTk4Ny4xNjc3NjE1NzYx*_ga_LGLX10VK 7K*MTY4MjI4NTEzMi4xMi4xLjE2ODIyODc5MjUuMC4wLjA.

Would forward to: showManageOrder&_gl=1*1k4fwrn*_ga*MTkwMjQ5OTk4Ny4xNjc3NjE1NzYx*_ga_LGL X10VK7K*MTY4MjI4NTEzMi4xMi4xLjE2ODIyODc5MjUuMC4wLjA.

Inbound link problem solved!

As for outbound links (when Keap/Infusionsoft sends traffic back to the main domain)... the GA4 JavaScript will give you the data for the _gl value and it will need to be persisted as traffic leaves the Keap/Infusionsoft cart and lands back on the main domain.

I'd also recommend that the fix for redirects utilizes an array of "GET vars to forward" (a whitelist) so in the future if/when the need arises to fix anything else similar to this, you simply add the new var(s) to the array.


Google's Developer Documentation on how GA4 cross-domain tracking works is available at: The rules are: When moving from one domain to another, the _gl data must be persisted and read by GA4 JavaScript on the receiving page, or the session breaks.

Related Resources

How To Create Your Measurement Protocol API Secret

Article Feedback

If anything here is incorrect, outdated, or omits critical information, please use our contact us form and let us know.