Mixpanel Community Icon

Top 10 Search Terms Report for Last 3 Months Using 'Search' Event

·
·

I got an event 'Search' which has a property 'SearchTerm' that contains strings of the search terms. How can I create a report, that shows the top 10 search terms of the last 3 Months?

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Hi Tobias, Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹

    Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    To create a report showing the top 10 search terms from the last 3 months for your 'Search' event with the 'SearchTerm' property, you can use Mixpanel's Insights report. Here's how you can do it:1. Start by creating a new Insights report.2. In the query builder: - Select the 'Search' event - Set the date range to "Last 3 months" using the date range selector Mixpanel Docs: Date Range3. To get the top search terms: - Use the 'SearchTerm' property as a breakdown - Limit the results to the top 10 valuesWhile the exact UI steps aren't provided in the given knowledge sources, we can infer that this approach should work based on Mixpanel's capabilities described in the documents.For a more programmatic approach, you could use Mixpanel's JQL (JavaScript Query Language) to achieve this. Here's an example of how you might structure the query:LBKSfunction main() { return Events({ from_date: "2023-07-01", to_date: "2023-09-30", event_selectors: [{event: "Search"}] }) .groupBy(["properties.SearchTerm"], mixpanel.reducer.count()) .reduce([mixpanel.reducer.top](http://mixpanel.reducer.top)(10)); }LBKSThis JQL query would: 1. Select 'Search' events from the last 3 months (adjust the dates as needed) 2. Group the events by the 'SearchTerm' property 3. Count the occurrences of each search term 4. Return only the top 10 resultsMixpanel Docs: JQL Mixpanel Docs: mixpanel.reducer.top(limit)Remember that JQL is in maintenance mode, so the Insights report method might be more future-proof.

    kapa.ai is still learning and improving, please let me know how I did by reacting below.

    ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.