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

Is it possible to configure sub-domains as different agencies?

hamptonmf opened this issue · comments

I need to implement this for 2 domains, one of which has 2 sub-domains that we need reported as different "agencies." Do I need to have 4 installs of analytics-reporter? Or can I configure one install to send the json data to 4 different folders?

Thanks,
Michael

It's all per- your Google Analytics configuration. DAP/18F uses "agencies" because that's how the Google Analytics account's profiles are arranged.

analytics-reporter gets reports from specific profiles (by view ID). The easiest way may be to have all of your analytics report into one profile, and then create "views" that correspond to segments of the profile. If you can't do that, and every domain/subdomain is in its own fully separate profile, then you'll need to run analytics-reporter separately for each of those.

In any case, you can use environment variables to use the same install of analytics-reporter to run reports against many different profiles. You don't have to install it multiple times under any conditions.

Thanks. We set up each of the sub-domains as its own Google Analytics account because we've distributed who is responsible for each sub-domain's reporting. I have access to all of them because of my position.

If I have the json data go to sub-folders within one "data" main directory, will the serve command also serve the sub-directories?

data -> lottery
data -> DOR
data -> team-sites
etc.

Thanks again,
Michael

Yep -- you can structure this however you want. You can run serve commands from the top directory and it will serve subdirectories, or 4 separate serve commands that each use their own port. You can have data output to directories on disk, or to S3 buckets.

In either case, you need to make sure the site repo is configured to point to the right base data URL(s).

Cool. That should work for us.

Thanks again,
Michael