sul-dlss / wallscreens

📺 curated experiences for touch-screen installations on the stanford campus
Other
1 stars 0 forks source link

analytics environments #181

Closed thatbudakguy closed 2 years ago

thatbudakguy commented 2 years ago

see #121 mutually exclusive with #189; a different approach to the same problem

Goals:

draft because still trying to figure out how to correctly send the info to GA & have it show up there

was able to confirm this works using the approach from this 2020 article, which is a strange hybrid of methods from google's own docs. request payload looks like this; note the environment param with every event call:

Screen Shot 2021-11-09 at 3 18 51 PM

the impact of this will be that we'll start getting events in analytics that are tagged with the environment netlify, and we won't get any more events from local dev. old events from local dev will show (not set) for their environment.

if we want to track events from the physical wallscreens separately, we can do JEKYLL_ENV=production jekyll build to create a build that will tag its events as production. alternatively, we can even set JEKYLL_ENV to wallscreen11 or something like that and create builds with separate environment values per physical wallscreen.

i haven't figured out a great way to surface data on the custom dimension yet, and it looks like it might take 24-48hrs to even be effective in GA anyway...more investigating to do.

here's one way to view the data in GA, on the Life Cycle -> Engagement -> Events page:

https://user-images.githubusercontent.com/4924494/141160350-15f4b2fd-d899-4231-a87b-126773762869.mov

netlify[bot] commented 2 years ago

✔️ Deploy Preview for sul-wallscreens ready!

🔨 Explore the source changes: 2faeedb5b9e60febefe4ccf0ddddc03ec13a5742

🔍 Inspect the deploy log: https://app.netlify.com/sites/sul-wallscreens/deploys/618b01e7220062000897c605

😎 Browse the preview: https://deploy-preview-181--sul-wallscreens.netlify.app

thatbudakguy commented 2 years ago

closing this in favor of #189, though we could reference this later if we wanted to get fancy with custom environment values.