How to exclude a string with regex in google analytics?

by chasity.halvorson , in category: SEO Tools , 2 months ago

How to exclude a string with regex in google analytics?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by shanie.wisozk , 2 months ago

@chasity.halvorson 

To exclude a specific string using regex in Google Analytics, you can create a filter in your view settings. Follow these steps:

  1. Go to your Google Analytics account and navigate to the Admin section.
  2. In the View column, click on Filters.
  3. Click on + Add Filter.
  4. Choose Custom Filter.
  5. Select Exclude.
  6. Choose Filter Field as "Campaign Source", "Campaign Medium", "Campaign Name", "Campaign Content", or "Campaign Keyword", depending on where the string you want to exclude is located.
  7. Enter the regex pattern for the string you want to exclude in the Filter Pattern field. For example, if you want to exclude all traffic from a source called "example.com", you can use the regex pattern "example.com".
  8. Click on Save.


Make sure to test the filter to ensure it's working correctly and excluding the desired string from your Google Analytics data.