Problem/Motivation
After connecting Drupal with SearchStax and creating multiple languages, the analytics click data doesn't reflect for those individual languages.
This happens because the "language" parameter isn't being sent in the track/ request payload when the event is "_searchclick", which is required to correctly target a specific language 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 language.
- Install and enable the SearchStax module on Drupal.
- On SearchStax, create a new language.
- 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 for multiple languages.
- Perform a test search for a specific language, click on a result, and note the track/ API request payload. To decode the payload, you can go to https://www.base64decode.org/
- You should see that the "language" param isn't included in the payload body, which means the analytics data will not get stored and reflected under that particular language on the Site Search dashboard.
Proposed resolution
Pass in the language code value in the "language" param of track/ API request payload for "_searchclick" event as specified in the Analytics REST API doc.
Issue fork searchstax-3577349
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 #5
drunken monkeyI just merged this MR which should fix the problem. Please test in the dev version of the module.
Comment #6
drunken monkeyThis has now been confirmed to work as intended and released as part of version 1.10.0.