Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Is there ability to run a report on search terms a customer is using when visiting website?

Avatar

Level 2

I am trying to find out what keyword search terms a customer may be using when they visit our website. Does AEM have the ability to run such a report?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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:

    JavaScript
    function handleSearch() {
        var searchQuery = document.getElementById("search-input").value;
    
        // Set the s.eVar value
        s.eVar1 = searchQuery;
    
        // Trigger the Adobe Analytics tracking beacon
        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 .

Himanshu Jain

View solution in original post

4 Replies

Avatar

Community Advisor

@AnthonyJ_Battag IAre you talking about the search term used in say google and clicked a web link to your website?  If the search page present in AEM, I dont think AEM provides OOTB analytics report in your AEM search application. You can easily integrate with Adobe Analytics and track it every time the user search. Please clarify what is the use case you are referring to ?

Thank you, yes, I did mean the search page on our website powered by AEM. That would require Adobe Analytics it appears. 

Avatar

Community Advisor

Hi @AnthonyJ_Battag ,

Use capture event on search box and on input it will be tracked by analytics .

 

Thanks

Himanshu Jain

Avatar

Correct answer by
Community Advisor

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:

    JavaScript
    function handleSearch() {
        var searchQuery = document.getElementById("search-input").value;
    
        // Set the s.eVar value
        s.eVar1 = searchQuery;
    
        // Trigger the Adobe Analytics tracking beacon
        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 .

Himanshu Jain