Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Google Analytics & feedback component #120

Merged
merged 11 commits into from
Jan 30, 2024
Merged

Conversation

Jpoliachik
Copy link
Contributor

@Jpoliachik Jpoliachik commented Jan 22, 2024

  • Added Google Analytics using Docasaurus plugin
  • Created Feedback widget, and send GA event on click
  • Added privacy policy link to footer (requirement for using GA)

This PR is a modification of #2, but using Google Analytics instead of HappyReact

Reasons:

  • We wanted GA integration to get basic page view analytics anyways, so using it for the feedback widget reduced our third party dependencies
  • GA gives us more options for handling feedback data, compared to HappyReact which doesn't support any notifications or integrations on backend. (HappyReact is verrry barebones)
  • We gain more control by owning the widget instead of loading a third party UI & script.
image image

And the events show up in Google Analytics, which we can report on or send notifications in response to:
image

@Jpoliachik Jpoliachik marked this pull request as ready for review January 22, 2024 20:07
@Jpoliachik Jpoliachik requested a review from cdanwards January 30, 2024 18:54
};

export default function Feedback({ resource }) {
const [reaction, setReaction] = useState(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we care about any type of persistence for this (local storage or beyond?)? probably not, but just adding an note.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good callout - I went with the easiest route, but that does allow users to full-refresh and vote again. didn't think it was worth the effort for now, but we can keep an eye on stats and add it later if needed.
FWIW I noticed that other docs sites (reactnative.dev, docs.expo.dev) do the same thing.

Copy link
Member

@yulolimum yulolimum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

impressive work

@Jpoliachik Jpoliachik merged commit 310381f into main Jan 30, 2024
1 check passed
@Jpoliachik Jpoliachik deleted the feat/ga-feedback-widget branch January 30, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants