Google Analytics 4 Integration
Spefix can send search events directly to your GA4 — this lets you analyze search behavior in the context of your site's overall analytics.
This integration is disabled by default. Contact support to enable it.
💬 Telegram: @spefix_pm • 📧 [email protected]
Events sent to GA4
search
Records that a search happened. Fires a few seconds after results are displayed — this avoids extra events from incomplete queries.
| Parameter | Description |
|---|---|
search_term | The search query |
search_source | Always spefix |
search_results_count | Number of results |
search_type | autocomplete or fulltext |
search_had_results | true or false |
view_search_results
What the shopper saw in the results. Sent together with search, only if there are results.
Passes an array of visible products (items) — up to 20. Each product includes:
| Field | Description |
|---|---|
item_id | Product ID |
item_name | Product name |
item_category | Category |
item_brand | Brand |
price | Price |
currency | Currency |
index | Position in results (0-based) |
item_list_id | Always spefix_search |
item_list_name | Always Spefix Search Results |
select_item
A shopper's click on a product from the search results. Contains one product with the same fields as view_search_results.
item_list_id: 'spefix_search' — the key for filtering in GA4. Lets you distinguish clicks from search from those from the catalog, recommendations, and other sources.
Use the item_list_id = spefix_search filter in GA4 to see only interactions from Spefix search.
Why can the data in GA4 and the Spefix dashboard differ?
Analytics in the Spefix dashboard is more accurate — here's why.
How dashboard analytics works: Spefix collects all search queries over a few minutes, after which AI aggregates them and removes noise — unfinished queries, duplicates, intermediate variants. In the dashboard you see the real picture without the extra noise.
How sending to GA4 works: GA4 doesn't support aggregation on Spefix's side, so events are sent a few seconds after results are displayed. This can cause discrepancies:
- A shopper finds a product and clicks it within 2-3 seconds → the
searchevent might not make it to GA4 in time, but it's still recorded in the dashboard - A shopper closes the search right after seeing results → same situation
A discrepancy between the data in the Spefix dashboard and GA4 is normal. Treat the Spefix dashboard as the primary source of search analytics.
Technical details
- If
gtagisn't set up on the site — the integration silently doesn't fire, nothing breaks - The setting is enabled individually per domain
- Self-service enabling via the dashboard isn't available yet — planned for future updates