Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Google and Search.gov analytics

Julie Strothman edited this page Jan 22, 2021 · 3 revisions

Site search data in GA

We want our search.gov data to appear in our google analytics.

Constraints:

  • Our GA is a view on the Microsites property, i.e. lots of sites use the same tracking code, so if we have search.gov make a call to GS using our tracking ID, we need to distinguish which search data is specific to the UX Guide (for search terms reporting and more importantly for visits data--so that a search result page for, e.g. TTS Handbook, doesn’t get counted as a visit for the UX Guide)
  • We can’t set up domain masking for search.gov (i.e. showing our results at search.ux-guide.18f.gov) b/c Search.gov only supports top-level domain masking.
  • We can use a GA search category for ‘affiliate’ to distinguish search for our site: the URL includes the affiliate ID (this doesn’t address the issue of ignoring visits to search results for other 18F sites that use this GA ID)

1/13/2021

  • In GA, we set the view’s Site Search Settings to use the query parameter = ‘query’ and category = ‘affiliate’
  • In GA, we set the view’s filter “ux-guide.18f.gov/ only” to test for page title = “User Experience Design Guide” instead of hostname.
    • Search results page title: “[search term] - 18F User Experience Design Guide Search Results”
    • UX Guide page title: “[page name] | 18F User Experience Design Guide”

1/22/2021

  • In GA, we set the view’s filter “ux-guide.18f.gov/ only” back to test only for the hostname "ux-guide.18f.gov". Unfortunately, unless we address cross-domain tracking, visits where someone goes from site > search results > back to site, appear as two sessions

For analysis of visits with search

  • Use the view "18F Handbook" which has no filters--includes traffic to all sites on the property
  • Apply an audience segment for the site you want to analyze, e.g. sessions where the hostname includes ux-guide.18f.gov
  • Filter GA search term queries to include results only where the site search category contains ux-guide.18f.gov
  • Don't use this view for accurate counts of visits or time-on-site, as it double-counts any pogo-sticking from site to search. Rather this can be used to assess pathways related to search, if you are looking for more detailed information than is in your Search.gov dashboard.