MobilityData / gtfs-validator

Canonical GTFS Validator project for schedule (static) files.
https://gtfs-validator.mobilitydata.org/
Apache License 2.0
288 stars 101 forks source link

Web Validator: Add Google Analytic tracking code #1391

Closed themightychris closed 1 year ago

themightychris commented 1 year ago

@ryon embed the following GA tracking code in the web interface:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-NXV73Q9HBS"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-NXV73Q9HBS');
</script>
isabelle-dr commented 1 year ago

@themightychris what are we going to be able to track with this?

themightychris commented 1 year ago

@isabelle-dr we don't have access to the Google Tags Manager account this links to, that's where most of the control is over what tracking happens. Presumably it's at least going to feed into a Google Analytics account that will record profiles of traffic opening the main page. We are not embedding any tracking code in the report.html so we won't see people entering those pages, but depending on how Google Tag Manager is configured it could be set up there to record clicking on the "report ready" button that links to it.

themightychris commented 1 year ago

@KClough #1407 was merged but the analytics tag doesn't appear to be rendering if you view source on https://gtfs-validator.mobilitydata.org/—looks like the only thing that could stop it is the dev flag so investigate why that might be active still in prod

themightychris commented 1 year ago

Closing as this was already initially merged in #1407 and #1458 covers looking into why it's not working in production