Connecting Wix Site Search to GA4: tracking search queries as custom events
Module 67: Wix Site Search Optimisation | Lesson 679 of 687 | 27 min read
By Michael Andrews, Wix SEO Expert UK
Google Analytics 4 can capture every search query typed into your Wix Site Search bar, giving you a rich dataset of user intent signals directly from your own audience. The default GA4 site search tracking requires some configuration in both GA4 and your Wix settings. Once set up, you can see exactly what your visitors search for, how often, and what they do after searching — data that most businesses never fully leverage for SEO.
Enabling Site Search Tracking in GA4
Complete setup for GA4 site search tracking on Wix
- Open Google Analytics 4 and go to Admin > Property Settings > Reporting > Site Search.
- Enable the "Site search" toggle.
- Enter the query parameter used by Wix Site Search — this is typically "q" but verify by doing a test search on your site and looking at the URL (e.g. yoursite.com/search?q=testquery).
- Save the settings. GA4 will now automatically track the search_term parameter in the view_search_results event.
- Navigate to Reports > Engagement > Events and confirm that "view_search_results" events are being captured.
- Create a custom report in GA4 Explorations to see search terms alongside session metrics: bounce rate, conversion rate, and pages viewed per session after searching.
Creating Custom Events for Advanced Search Tracking
Beyond the standard view_search_results event, you can use Wix Velo to push custom events to GA4's data layer, capturing additional context like which category of results the user clicked on, whether the query returned zero results, and how far down the results page a user scrolled before clicking. This richer tracking data enables far more sophisticated content gap analysis.
// Wix Velo code to send custom search events to GA4
// Add to your search results page code
import { trackEvent } from 'wix-analytics-js';
$w.onReady(function () {
const searchQuery = new URLSearchParams(location.search).get('q');
if (searchQuery) {
// Check if there are any results
$w('#searchResults').onReady(() => {
const resultCount = $w('#searchResults').getCount();
if (resultCount === 0) {
// Track zero-results searches separately
trackEvent('zero_results_search', {
search_term: searchQuery,
result_count: 0
});
} else {
trackEvent('successful_search', {
search_term: searchQuery,
result_count: resultCount
});
}
});
}
});
Analysing Site Search Data for SEO Insights
- Top search terms with high volume and low click-through rates signal that your existing content does not match user intent
- Zero-results queries are direct evidence of content gaps — create pages targeting these topics
- Terms searched frequently but not targeted in your SEO strategy are keyword opportunities you are missing
- Queries that lead to high engagement after clicking suggest content that resonates — expand on these topics
- Seasonal patterns in search terms reveal when specific content needs to be published or promoted
This lesson on Connecting Wix Site Search to GA4: tracking search queries as custom events is part of Module 67: Wix Site Search Optimisation in The Most Comprehensive Complete Wix SEO Course in the World (2026 Edition). Created by Michael Andrews, the UK's No.1 Wix SEO Expert with 14 years of hands-on experience, 750+ completed Wix SEO projects and 425+ verified five-star reviews.