How to Remove Query String in GA4 | BCS How to Remove Query String in GA4 | BCSBCS

How to Remove Query String in GA4

Google Analytics BCS 1 years ago (2023-01-21) 1076 Views 0 Comments

This article will introduce how to remove Query String in GA4

Issue

If there are many query parameters on the URL, it will cause many lines to be displayed on the same page, which is not intuitive:

How to Remove Query String in GA4

The solution is to remove the Query String.

Currently GA4 does not support removing Query String, but it can be done in GTM.

 

Configuration

Suppose now to remove the fbclid parameter.

There is a variable template called Trim Query in GTM, we can use it to remove Query String.

Variables

First add the Trim Query variable template.

In GTM, click「Templates」——「Search Gallery」in Variable Templates, and search for “Trim Query“:

How to Remove Query String in GA4

 

Click to add it to Workspace, the final effect:

How to Remove Query String in GA4

The second step is to create a Trim Query variable and remove the Query String.

In GTM, click「Variables」——「New」——「Choose a variable type to begin setup…」——「Trim Query」,Then name it “Page URL (Remove Query String)” and make the following settings:

How to Remove Query String in GA4

 

Tags

The next step is to adjust the tags of GA4‘s, open the tags of GA4‘s, and cover page_location with “Page URL (Remove Query String)”:

How to Remove Query String in GA4

 

Preview

The last step is to preview and debug.

Click 「Preview」in GTM:

How to Remove Query String in GA4

 

Enter https://www.bbccss.com?fbclid=PAAaYWoW in Tag Assistant:

How to Remove Query String in GA4

Uncheck “Include debug signal in the URL” and click “Connect”.

Enter the test state and return to Tag Assistant,Click 「Container Loaded」, then click GA4’s Tag, click 「value」 in the upper right cornerHow to Remove Query String in GA4

page_location is no fbclid parameter.

 

You can also check it in DebugView in GA4:

How to Remove Query String in GA4

page_location is no fbclid parameter. 

Indicates that the configuration is successful.

 

Summary

This setting is set on GTM, because the data cannot be traced back, please make sure that you really do not need this Query String before setting it.


If you don't understand, You can leave a comment below.
Like (0)
Post my comment
Cancel comment
Expression Bold Strikethrough Center Italic

Hi, you need to fill in your nickname and email!

  • Nickname (required)
  • Email (required)
  • Website