This PR conditionally adds the GA4 script to index.html when building for production only (GA is disabled in development mode) and uses the gtag() function to record the following events:
search (general searches)
params: search_term
search_no_results (searches with no results)
params: search_term
icon_selected (an icon has been clicked/modal opened)
params: icon_name
GA4 automatically tracks page views (page_view) and link clicks/downloads (gtm.linkClick) so these events aren't tracked programmatically.
Additionally, the "Privacy Notice" link is added to the app, below the "Download All" button.
Resolves #26
This PR conditionally adds the GA4 script to
index.html
when building for production only (GA is disabled in development mode) and uses thegtag()
function to record the following events:search
(general searches)search_term
search_no_results
(searches with no results)search_term
icon_selected
(an icon has been clicked/modal opened)icon_name
GA4 automatically tracks page views (
page_view
) and link clicks/downloads (gtm.linkClick
) so these events aren't tracked programmatically.Additionally, the "Privacy Notice" link is added to the app, below the "Download All" button.