This event marks a visitors search action for items on a search result page
Using the Tweakwise JS implementation?When using the Tweakwise JS implementation, this event is automatically submitted when the base script is included. You won't need any additional implementation for this event.
How to implement?
<!-- This event is already included in the base tag, only implement this manually for custom scenarios-->
<!-- INSTANCE_KEY SESSION_KEY AND PROFILE_KEY are inherited from the base tag -->
<script>
tweakwiseLayer.push({
event: 'search',
data: {
searchTerm: 'SEARCH_TERM'
}
});
</script>curl --request POST \
--url 'https://navigator-analytics.tweakwise.com/api/search?instanceKey=INSTANCE_KEY' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"ProfileKey": "PROFILE_KEY",
"SearchTerm": "SEARCH_TERM",
"SessionKey": "SESSION_KEY"
}
'Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| INSTANCE_KEY | URL-parameter - text | yes | Your Tweakwise Instance Key |
SEARCH_TERM | Body parameter - text | yes | The term being searched for |
SESSION_KEY | Body parameter - text | yes | The session key for the specific user. This can be your own session key or GA session. As long as it's consistent throughout the user's session. Allowed characters: alphanumeric and hyphens |
| PROFILE_KEY | Body parameter - text | yes | The ID that identifies the current visitor. Read more about the profile key here |
When do I submit this event?
Submit this event for every display of a search results page.
Do not submit for suggestionsDo not submit this event when showing suggestions. Suggestions are updated on every keystroke, resulting in submitting events for unfinished words or sentences. This will result in an incorrect view of the search behavior of a visitor.
Where do I implement this event in the code?
On the search results page.
How to handle event-specific warnings from Tweakwise
No Searches received in the last 4 days
Description
No Searches events have been received in the last 4 days.
Possible solution
Check if the search functionality on the platform is working properly and ensure that the Tweakwise tracking/event tag for search queries is being triggered correctly on every search action on the search results page.
SessionKey: xx% missing / ProfileKey: xx% missing/SearchTerm: xx% missing
Mismatched sessionkeys in this event and SessionStart (xx%)
Description
More than 5% of the Searches events contain a SessionKey that does not match a known SessionStart event.
Possible solution
Check the creation and lifespan of session cookies/keys on the platform. Make sure that when a session starts, the SessionStart event is triggered before or together with other events.
Please share your findings with your implementation partner. If they have questions about these messages, please have them contact [email protected]
