This may be a stupid question, but is it possible to capture what a user typed into a Google search box, so that this can then be used to generate a dynamic page on the landing page on my Web site?
For example, let's say someone searches Google for "hot dog", and my site comes up as one of the search result links. If the user clicks the link that directs them to my Web site, is it possible for me to somehow know or capture the "hot dog" text from the Google search box, so that I can call a script that searches my local database for content related to hot dogs, and then display that? It seems totally impossible to me, but I don't really know. Thanks.
To access the report, log into Search Console, and then click “Search Traffic” in the left-hand navigation. Search Analytics is the first report listed within this menu option. If you're not able to access Search Console, it may be because you have to verify your website first.
Just type in the Google search box, and related terms will display in a drop-down list. You can then manually select the long-tail keyword phrase you want to use or pick a combination of phrases.
The Google Analytics Site Search reports allow you to see the search terms people use, the pages where they start their search, and the pages they navigate to from your search results page. These reports can provide insights into your content, navigation, and even your search campaigns.
I'd do it like this
$referringPage = parse_url( $_SERVER['HTTP_REFERER'] );
if ( stristr( $referringPage['host'], 'google.' ) )
{
parse_str( $referringPage['query'], $queryVars );
echo $queryVars['q']; // This is the search term used
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With