A Google Clone created with ReactJs, Google API(Rapid Api), React-router, Firebase, Context Api for state management, Styled-components and Material-UI.
This PR adds Google Analytics tracking for search events in the Google Clone ReactJS project. Whenever a search is made, the search term will be sent as an event to Google Analytics.
Summary of Changes
Created a new file my-app/src/utils/GoogleAnalytics.js to handle the Google Analytics tracking code.
Imported the sendSearchEvent function from my-app/src/utils/GoogleAnalytics.js in my-app/src/components/Results/index.js.
Called the sendSearchEvent function with the search term in the useEffect hook in my-app/src/components/Results/index.js.
Imported react-ga and initialized it with the Google Analytics tracking ID in my-app/src/index.js.
Sent a page view to Google Analytics in my-app/src/index.js to track page visits.
Please review and merge these changes.
Fixes #2.
🎉 Latest improvements to Sweep:
Sweep can now passively improve your repository! Check out Rules to learn more.
💡 To get Sweep to edit this pull request, you can:
Leave a comment below to get Sweep to edit the entire PR
Leave a comment in the code to only modify the file
Edit the original issue to get Sweep to recreate the PR from scratch
PR Feedback (click)
Description
This PR adds Google Analytics tracking for search events in the Google Clone ReactJS project. Whenever a search is made, the search term will be sent as an event to Google Analytics.
Summary of Changes
my-app/src/utils/GoogleAnalytics.js
to handle the Google Analytics tracking code.sendSearchEvent
function frommy-app/src/utils/GoogleAnalytics.js
inmy-app/src/components/Results/index.js
.sendSearchEvent
function with the search term in theuseEffect
hook inmy-app/src/components/Results/index.js
.react-ga
and initialized it with the Google Analytics tracking ID inmy-app/src/index.js
.my-app/src/index.js
to track page visits.Please review and merge these changes.
Fixes #2.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: