NASA-IMPACT / EIC-Mobile

EIC Mobile Concept
https://earth.gov/mobile-climate-mapper/
1 stars 0 forks source link

Analytics #12

Closed j08lue closed 2 days ago

j08lue commented 1 month ago

We need to set up analytics.

Should it be Google Analytics or Plausible (DevSeed is using that on many websites), owned by NASA/EIC or something DevSeed quickly sets up in their account?

What are the requirements / wishes towards analytics, @agurvich?

agurvich commented 1 month ago

Some initial thoughts that I would not say are must haves but seem like reasonable targets:

  1. QR code from Hometown Dashboard should get a unique UTM code
  2. 2nd, more general, QR code should have its own unique UTM code (this is what we share with others)
  3. Embed a UTM code in urls generated by social media share button in the application
    • Unique but following a pattern? single "shared from application" UTM code? I don't have a lot of background for this so I'm not sure what is best practice.
  4. UTM code for the link from the as-of-yet-to-be-created Earth.gov/visit/nmnh page
  5. Assume traffic from non-UTM-coded urls are from seeing the URL written out (i.e. in a tweet/SM post by someone who doesn't confer with us ahead of time and/or written out on other promotional media).
aboydnw commented 1 month ago

from setting up GA, the main thing we need to know is if this should be it's own property or not. If the plan is to eventually fold this into the larger earth.gov website then I would say we just copy the GA embed code on the main site and use it here

agurvich commented 1 month ago

How do we want to proceed on this? I'm happy to do whatever and just got the clear to produce a QR code myself; so we don't need to go through comms or get any extra approval.

aboydnw commented 1 month ago

If we're done with load testing, and we want to implement the same google property as the larger earth.gov app, then we just need to make sure this tag appears high up in the header:

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5FNFVTFM');</script>
<!-- End Google Tag Manager -->

and that this tag appears high up in the body:

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5FNFVTFM"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

If we want to have a dedicated google property because this will be an independent app for the foreseeable future, then let me know and I can create that. This just saves us from having to recreate all the settings and such

aboydnw commented 1 month ago

@agurvich as far as creating the URLs, you can do that irrespective of the GA implementation. It just won't be tracked until we have GA setup

dzole0311 commented 1 month ago

PR with the code: https://github.com/NASA-IMPACT/EIC-Mobile/pull/61