18F / analytics-reporter

Lightweight analytics reporting and publishing tool for Digital Analytics Program's Google Analytics 360 data.

Home Page:https://analytics.usa.gov/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexplained `https://example.gov` showing up in production data

konklone opened this issue · comments

The live data here shows a domain value of https://example.gov:

https://analytics.usa.gov/data/live/realtime.json

{
  "name": "realtime",
  "query": {
    "metrics": [
      "rt:activeUsers"
    ],
    "max-results": 10000
  },
  "meta": {
    "name": "Active Users Right Now",
    "description": "Number of users currently visiting all sites."
  },
  "data": [
    {
      "active_visitors": "103435",
      "domain": "https://example.gov"
    }
  ],
  "totals": {},
  "taken_at": "2017-01-14T22:21:39.786Z"
}

I'm not sure why that is, but it's the first I've noticed it.

The only place I see that in the code is here, in the example env. It looks like that managed to sneak into the production env when I deployed the first time.

Also, this managed to find its way in there:

It: It
Optional:: Optional:
a: a
be: be
defaults: defaults
here.: here.
hostname,: hostname,
if: if
inside: inside
it: it
module: module
page: page
paths.: paths.
prepended: prepended
profile: profile
reports/reports.json: reports/reports.json
set: set
single: single
to: to
uses: uses
will: will
your: your

So this one looks likes its on me.

I'll reset the environment and re-run the generate-env.

So, it looks like generate-env does not recognize that comments in .env are comments.

After removing comments from my .env, I've regenerated the environment and the data is back to the way it should be: https://analytics.usa.gov/data/live/realtime.json.

I would recommend removing the generate-env script entirely -- it has other bugs which have broken the production deployment.