Problem/Motivation
After connecting Drupal with SearchStax and creating multiple profiles, the analytics data doesn't reflect for those individual profiles.
This happens because the "model" parameter isn't being sent in the track/ request payload, which is required to correctly target a specific search profile to store analytics data.
Steps to reproduce
- Create a Drupal app and connect to a SearchStax app with the ability to create more than 1 search profile.
- Install and enable the SearchStax module on Drupal.
- On SearchStax, create a new search profile.
- On Drupal, under Configuration > Search and metadata > SearchStax settings, check the boxes which say "Re-route searches through SearchStudio" and "Configure searches via SearchStudio".
- Create a Search view and populate content for testing.
- Connect the search profile to the Drupal Views by going to the settings for the view, then clicking the query options under Advanced settings section, and selecting the profile you want to test with. Hit Save.
- Perform a test search and note the track/ API request payload. To decode the payload, you can go to https://www.base64decode.org/
- You should see that the "model" param isn't included in the payload body, which means the analytics data will get stored and reflected under "All Profiles" on the Site Search dashboard, but that specific profile's analytics view would be empty.
Proposed resolution
Pass in the model name in the "model" param of track/ API request payload as specified in the Analytics REST API doc.
Issue fork searchstax-3572035
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
drunken monkeyComment #6
drunken monkeyMerged to HEAD, will be tested there.
Comment #7
pavlosdanProbably out of scope for this ticket but since analytics is being worked on here thought I'd ask here before opening a new ticket. Similar to how autosuggest key was moved to the search server settings, could we move the analytics URL and key over there as well to accommodate multi-tenant applications?
Please let me know if you'd like me to open a new ticket!
Thanks,
Pavlos
Comment #8
drunken monkeyYes, please do create a new ticket for that, let’s discuss there.
I already see a difference, though, in that analytics isn’t directly linked to a server/app – you might want to use a single analytics key for multiple apps, or different analytics keys for different searches on the same app. Therefore, it seems our current system of per-search overrides (even though hidden from the UI in #3586335: Clean up the Settings page, admittedly) might actually be more flexible than per-server settings.
But please do create a new ticket and we’ll discuss what the best solution would be.
Comment #9
drunken monkeyOh, and this is of course long verified and released, so marking as fixed.