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

Move the template format to the event name (Google Analytics) #568

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

vgeorge
Copy link
Contributor

@vgeorge vgeorge commented Dec 13, 2023

Contributes to NASA-IMPACT/nasa-apt#807.

In #563 we added custom events for tracking template downloads by format, but it seems the event parameter template_format is not persisted after some time in the GA dashboard.

In this PR I moved the format to the event name, which should allow tracking download events by format older than 30 mins.

How to test:

  • Replace config/local.js with the content of config/staging.js
  • Run the app
  • Visit http://localhost:9000/new-atbd and download each of the available formats
  • Visit GA dashboard
  • Go to Reports -> Realtime
  • Box 'Event count' by 'Event name' should list the new event names:
    • atbd_template_download_google_docs
    • atbd_template_download_ms_word
    • atbd_template_download_latex

The other reports won't show the events right away because GA doesn't aggregate events for the current day. They should appear after they are older that 1 day.

@wrynearson this is ready for review.

Copy link
Member

@wrynearson wrynearson left a comment

Choose a reason for hiding this comment

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

This looks almost perfect. The only issue I have is that the Google Sheets template download statistics don't show up in GA.

image

@vgeorge
Copy link
Contributor Author

vgeorge commented Dec 18, 2023

@wrynearson are you referring to the Google Docs template? I tested it now, and the three format types are appearing in the Analytics console:

apt-stats

@wrynearson
Copy link
Member

Yes, I was referring to the Google Doc template. Let's push this.

@wrynearson wrynearson self-requested a review December 20, 2023 07:19
@wrynearson wrynearson merged commit 8f568c8 into develop Dec 20, 2023
14 checks passed
@wrynearson wrynearson deleted the fix/ga-download-events branch December 20, 2023 07:19
@wrynearson
Copy link
Member

@vgeorge was this updated with the Production GA code? cc @sunu

@vgeorge
Copy link
Contributor Author

vgeorge commented Dec 21, 2023

@wrynearson the events were appearing in the production panel, we don't need to update the code. The issue was with event parameters, which aren't persisted for more than 30 mins. We should be able to see the updated event names in production.

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.

2 participants