4

Is it possible to find out in real time what query a visitor searched before landing on your site?

Google switched the URL structure to precede query (q=) with a # instead of ? or & to avoid sending data in the URL. Now document.referrer is https://www.google.com with no parameters to parse.

Before: How does a website know the Google query I used to find it?

My goal is letting the website search its own database for related content or tools not indexed by Google.

Google Analytics has real time data. The limited beta API may enable joining a session via primary key (user_id or IP) to get their referring keyword.

Community
  • 1
  • 1
Dylan Valade
  • 5,565
  • 6
  • 42
  • 56
  • I'm pretty sure that since Google did this, they specifically **did not** want you to connect the user with the search query. – Anonymous Jul 09 '15 at 15:49
  • It seems more like Google's goal was doing it **differently, in a way they could track** with API calls. They give you tools and instructions to track individuals by non personally identifiable User ID (e.g. uuid) so this can already be done after the session with GA's reports. The next step is access to the same data when it's logged. https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id and https://support.google.com/analytics/answer/3123663?hl=en – Dylan Valade Jul 09 '15 at 17:33
  • 1
    don't appear so. "Search Query" and "Keywords" don't appear to be Realtime API dimensions: https://developers.google.com/analytics/devguides/reporting/realtime/dimsmets/ – M Schenkel Jul 14 '15 at 20:49
  • Good link, at second glance `rt_keyword` is in the dimension offering natural search or AdWords keywords. That might be the answer. https://developers.google.com/analytics/devguides/reporting/realtime/dimsmets/trafficsources#rt:keyword – Dylan Valade Jul 20 '15 at 16:25

0 Answers0