Have you ever wondered what people are searching for on your website? Tracking internal search terms can be super helpful. Here’s a simple step by step guide to set this up using Google Analytics 4 (GA4).
Step 1: Enable Enhanced Measurement
First, Enhanced Measurement needs to be enabled. This will automatically track user interactions.
- Go to Admin in GA4.
- Click on Data Streams.
- Select the data stream for your website.
- Check if Enhanced Measurement is turned on. If not, turn it on.

Step 2: Identify Your Query Parameter
Next, the query parameter needs to be found. This parameter is in the URL when someone searches on your site.
- Search on your website.
- The URL will change, showing the search term. Look for
?q=
or?s=
in the URL. For example, if the URL iswww.example.com/search?q=shoes
, thenq
is the query parameter.

Step 3: Set up Site Search
Now, site search needs to be set up in GA4.
- Go back to the Enhanced Measurement settings.
- Find the Site Search section.
- Enter the query parameter identified earlier (like
q
ors
). - Save the changes.

Step 4: Create a Custom Dimension
To see specific search terms, a custom dimension needs to be created.
- Go to Admin > Custom Definitions.
- Click on Create Custom Dimension.
- Name it
search_term
. - Set the scope to Event and provide a simple description.
- Enter
search_term
in the event parameter field. - Save this new custom dimension.


Step 5: Wait for Data
After these steps, wait for some time for data to show up in GA4. It usually takes around 24 to 72 hours for search term data to appear.
Analyzing Search Terms
Once data starts showing up, internal search terms can be analyzed:
- Go to Reports > Engagement > Events in GA4.
- Look for an event called
view_search_results
. - Click + Icon. Add Custom Event
- Now you can see the
search_term
dimension to see what users are searching for.



By tracking these search terms, you can get valuable insights on what visitors want on your site. This can help you improve content and make navigation easier for users.