GA4 attribution issues - Varnish removes GCLID

We are using Stape.io and are encountering a situation where a lot of our traffic is being attributed to direct source.

We have a Varnish VLC file, where Varnish removes the GCLID parameter to minimize the cache objects.

Could that be the reason why we have too much traffic attributed as none/direct traffic in GA4?

Best regards,
Jesper

Remove Google gclid parameters to minimize the cache objects

set req.url = regsuball(req.url,"\?gclid=[^&]+$","");

set req.url = regsuball(req.url,"\?gclid=[^&]+&","?");

set req.url = regsuball(req.url,"&gclid=[^&]+","");

Hi @Jesper_Brejning,

Do you use a consent banner on your site?

Yes, we use Usercentrics Cookiebot

Can you please give a screenshot of what your cookie banner looks like, interested in how it is located on your site or just give a link to the site?

And one more question. You remove the GCLID - this Google ADS click id and it affects the attribution there. Have you noticed any problems there?

  1. Here you see our cookie banner

  2. How can we test if the GCLID is sent to GA4/GADS

  3. Yesterday we added UTM parameters to our Merchant Center feed product urls, to test if that help

The banner looks fine. Often the problem you describe is due to the fact that the user lands on the site - ignores the consent because the banner is small somewhere in the corner (tags don’t work) and accepts the consent after going to some next pages (so his referrer and/or url parameters are lost).

I would recommend checking to see if you have any similar cases.

It’s also worth checking if you have double redirects, which can cause the source to be lost.

  1. How can we test if the GCLID is sent to GA4/GADS

The easiest thing to do:

  1. Add a test parameter like gclid=test123 to the url to set the cookie and simulate landing on the site from the adverts.
  2. Trigger any conversion you have
  3. In preview mode of the server container, trigger and see the payload of the Google ADS request that goes. Your gclid should be there