To capture search keywords in AEM Adobe Analytics, you'll need to implement custom tracking using the s.eVar variable. Here's a step-by-step guide:
1. Identify the Search Component:
- Determine the component or page where the search functionality is implemented in your AEM site.
2. Create a Custom s.eVar:
- In Adobe Analytics, create a new Custom Variable of type eVar.
- Give the eVar a descriptive name (e.g., "s.eVar1 - Search Keywords").
- Set the Persistence to Visit.
3. Implement Tracking in AEM:
-
Modify the search component's JavaScript to capture the search query and pass it to the s.eVar.
-
Here's a basic example using Javascript:
function handleSearch() {
var searchQuery = document.getElementById("search-input").value;
s.eVar1 = searchQuery;
s.tl(true);
}
-
Replace document.getElementById("search-input").value with the actual selector for your search input field.
4. Verify Tracking:
- Go to your AEM site and perform a search.
- Check your Adobe Analytics reports to see if the search keywords are being captured correctly.
Note: Response generated from AI .