Use the Statistics module to see what visitors search for when they use the search feature on your website. Track the actions that visitors take, if any, after they perform a search.
Use this data to make informed decisions about website content and determine if you need to add, remove, or adjust content to meet the needs of your visitors.
This feature lets you:
This list tells what is needed for Acquia Optimize to be able to track searches on your website:
This section gives instructions on how to set up Site Search.
Add the following script to your search results page in the <body> tag:
<script>
window.addEventListener('mon-script-loaded', () => {
const urlSearchParams = new URLSearchParams(window.location.search); const params = Object.fromEntries(urlSearchParams.entries());
if (params.searchString) { window.monsido_functions.trackSearch(params.searchString);
}
});
</script>
To make the script track site searches properly, you need to modify it slightly. Replace searchString
with the search query parameter that is used on your website.
To find this, do a search on your website and look at the URL of your search results page. The search query parameter name typically appears between the characters ?
and =
in the URL. Here are two examples:
Example 1
On this search results page, the query parameter name is keys
.
Example 2
On this search results page, the query parameter name is cludoquery
.
Notice that searchString
appears in two places in the script and you need to replace it in both places.
If we assume that our query parameter name is keys
, the script should be modified so that it looks like this:
<script>
window.addEventListener('mon-script-loaded', () => {
const urlSearchParams = new URLSearchParams(window.location.search); const params = Object.fromEntries(urlSearchParams.entries());
if (params.keys) { window.monsido_functions.trackSearch(params.keys);
}
});
</script>
For more information, see our developer docs section for advanced instructions:
Average no. of results pages viewed: When a visitors perform a search, they sometimes get several pages of search results. This field gives an average of how many search results pages that your visitors viewed for the search term. To track this data, you need an advanced script setup.
For more information, see the Site Search section in the Acquia Optimize tracking document in developer docs for advanced instructions:
It may take up to 24 hours for search data to appear in the application interface after a visitor does a search.
This section gives instructions on how to use the Site Search feature in the Statistics module.
Navigate to the Dashboard for your domain.
Locate the Statistics section and click to open it, or click Statistics (the broken pie chart icon) on the page menu bar:
Click the date on the upper right-hand side of the page to change to a specific date span.
For more information and setup instructions for the Statistics module, see:
Select Content from the menu on the left side of the Statistics landing page.
The menu expands. Select Site Search.
The landing page helps users to view the data collected and visualize the site search data in a bar chart.
The bar chart shows the following:
In addition, users can also:
For information on how to use Site Search, see the user guide article:
https://docs.acquia.com/acquia-optimize/features/statistics/statistics-site-search.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Wed Dec 11 2024 07:53:20 GMT+0000 (Coordinated Universal Time)