We recently migrated the search backend for a customer from native Shopify search to our in-house search. This customer does not use Hydrogen, so we had to integrate results from our search engine in the frontend using their Shopify theme. We did this by adding Javascript to the liquid template the renders the “/search” endpoint that essentially calls our search backend and replaces the native Shopify search results with our search results.
Now we’re noticing that the search conversions over time report is broken. The “sessions” value is non-zero, but all other values in the report are now zero.
Based on this note in the linked documentation:
To track storefront search in Shopify, your theme’s codebase must use the url property returned from search.results. All Shopify-developed themes are set up to track storefront search.
this isn’t really surprising. As part of the search result replacement, we are now using URLs generated by our search backend. Comparing the URLs generated by native Shopify search & our search backend, the only difference appears to be three query parameters injected by Shopify: _pos, _sid, and _ss
Since we’re still calling native Shopify search (it’s called server-side, so no way to disable it), we’re testing if it’s possible to fix the report by taking the _sid parameter returned by native Shopify search and appending it to our search result URLs. Our theory is that this is a “search ID” used by Shopify analytics to join product views with searches. However, this testing is very difficult & slow because Shopify states in the linked documentation that it can take up to 12 hours for events to be reflected in reports. Add in the fact that the reports only show aggregated hourly/daily totals and it becomes near impossible to debug how to fix Shopify’s search funnel tracking.
Has anyone dealt with a similar issue? Any advice on how to debug Shopify analytics or this issue in particular? Any info about how Shopify processes these tracking events in their backend when generating reports would also be very helpful!