Skip to main content

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.

info

This integration is disabled by default. Contact support to enable it.

💬 Telegram: @spefix_pm • 📧 [email protected]


Events sent to GA4

Records that a search happened. Fires a few seconds after results are displayed — this avoids extra events from incomplete queries.

ParameterDescription
search_termThe search query
search_sourceAlways spefix
search_results_countNumber of results
search_typeautocomplete or fulltext
search_had_resultstrue 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:

FieldDescription
item_idProduct ID
item_nameProduct name
item_categoryCategory
item_brandBrand
pricePrice
currencyCurrency
indexPosition in results (0-based)
item_list_idAlways spefix_search
item_list_nameAlways 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.

tip

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 search event 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
warning

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 gtag isn'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