How to Exclude the URL Parameter yclid, ysclid, _ym_debug in GA4

At the end of 2021, Yandex began experimentally using the new yclid parameter to improve recognition of new search queries. This was prompted by restrictions on third-party cookies in some browsers, which reduced the effectiveness of identifying search phrases in Yandex.Metrica. This innovation led to duplication and incorrect display of conversions in GA.

yclid — Yandex Click Identifier, Yandex Click ID — авторазметка Яндекс

How to disable the special parameter — ysclid — when navigating to your site from Yandex search results

Since Google Analytics 4 does not provide functionality comparable to Universal Analytics for excluding URL parameters at the view level, you need to set this up yourself through Google Tag Manager. Use third-party templates available in the GTM Template Gallery.

First, open your container in Google Tag Manager and go to the Templates section.

Гугл таг менеджер

Then use Search Gallery and enter the query Query. As a result, you will see various templates, including the popular Query Parameter Stripping Utility by CardinalPath. Add it to your workspace.

Query Parameter Stripping Utility

Next, create a new variable to exclude parameters by going to Variables and selecting Query Parameter Stripping Utility.

In the window that opens, you will see the following variable settings.

Configure the variable to exclude the required parameters, such as yclid and ysclid, by specifying them in the Only these parameters will be removed field.

Fill Field which needs parameters removed with {{Page URL}}.

After naming the variable, save it.

To finish, edit your Google Analytics 4 configuration tag. In Tags, open your existing GA4 tag and override the page_location parameter in Fields to Set using the new variable.

After making the changes, save them and verify that the setup works correctly by launching GTM Preview mode and adding the excluded parameters to your site’s URL.

Оцените статью