-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Reporter to output both UA and GA4 data in reports #726
Changes from all commits
cc76386
7adf277
7ba7b42
58eabdb
094f98a
74802fb
977c371
1d080e9
9b43c97
2c8b3ed
39b5177
5c8270c
21391bc
64c7edf
e34524f
7ad6364
50fae44
e7a2b66
a10d7d0
dd803d7
2095310
0702501
497d08f
1521523
ca9e008
61cb1d1
87fb391
7323c37
854acc0
600a5fb
44c3998
ca3a824
4055db0
aac641b
40936a0
2047754
4646dce
96296ad
d2b219d
16dbffc
c9c949d
5f66af5
9817e7e
f86cd1a
c3905f2
8ba1091
bb4f234
51224de
28250b9
3e150bf
e5b771e
a85bc5e
a5c7e69
689b1b3
36eeeba
057368f
0da368d
cabcf53
6135f7a
9f70af4
93e80a3
fd89a48
a5c061b
70fd073
8225e5f
f02f61c
865dc31
c1f05fa
bf9d565
3d5c00a
55604a3
41cc7e5
7d7e5a0
359c59b
cb620b7
5e27971
0b4e546
692e385
fbf4a53
7899c2c
fc50b6a
050a678
2d105f6
fda4347
2a2c622
610e7b0
e020f67
4c6ed95
3bcfa25
b082a03
07633b7
53ac0f0
fc8631b
0a2512a
8da80d1
e471b1b
2112bd9
91c6291
782c36c
3aa8ea6
fa55b66
8a24756
88ab8f9
2146577
7af60cc
b2928e8
e41f780
9fc2124
0867ad0
b05581b
36799b8
3f3f188
7853c15
2f29ef5
73bf719
c6dea43
4056ef3
f8dc3d0
83f7670
58ff0db
0b0b316
4469a8c
cde46c1
b88a966
e25735e
d75d583
bd9402a
77287bb
3506c5c
b613251
9b47c00
ea5a0c2
863a840
e0e35d6
27de716
c637dbb
b133bb8
5b71410
3236c48
3a1fcc4
0381e77
94a6e7a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff: true | ||
extension: ['js'] | ||
package: './package.json' | ||
slow: '75' | ||
spec: | ||
- 'test/**/*.js' | ||
- 'ua/test/**/*.js' | ||
timeout: '2000' | ||
ui: 'bdd' | ||
watch-files: | ||
- 'src/**/*.js' | ||
- 'test/**/*.js' | ||
- 'ua/src/**/*.js' | ||
- 'ua/test/**/*.js' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.11 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,22 @@ logger.info(" Running /deploy/cron.js"); | |
logger.info("==================================="); | ||
|
||
const scriptRootPath = `${process.env.ANALYTICS_ROOT_PATH}/deploy` | ||
const scriptUARootPath = `${process.env.ANALYTICS_UA_ROOT_PATH}/deploy` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. include a path to the ua app |
||
|
||
var api_ua_run = function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New method to run our ua application and write responses to the api database. We no longer need to send reports from UA to s3. |
||
logger.info("about to run ua api.sh"); | ||
console.log(`${scriptUARootPath}/api.sh`) | ||
var api = spawn(`${scriptUARootPath}/api.sh`) | ||
api.stdout.on("data", (data) => { | ||
logger.info("[ua - api.sh]", data.toString().trim()) | ||
}) | ||
api.stderr.on("data", (data) => { | ||
logger.info("[ua - api.sh]", data.toString().trim()) | ||
}) | ||
api.on("exit", (code) => { | ||
logger.info("ua - api.sh exitted with code:", code) | ||
}) | ||
} | ||
|
||
var api_run = function() { | ||
logger.info("about to run api.sh"); | ||
|
@@ -37,50 +53,50 @@ var api_run = function() { | |
}) | ||
} | ||
|
||
// var daily_run = function() { | ||
// logger.info("about to run daily.sh"); | ||
|
||
// var daily = spawn(`${scriptRootPath}/daily.sh`) | ||
// daily.stdout.on("data", (data) => { | ||
// logger.info("[daily.sh]", data.toString().trim()) | ||
// }) | ||
// daily.stderr.on("data", (data) => { | ||
// logger.info("[daily.sh]", data.toString().trim()) | ||
// }) | ||
// daily.on("exit", (code) => { | ||
// logger.info("daily.sh exitted with code:", code) | ||
// }) | ||
// } | ||
|
||
// var hourly_run = function(){ | ||
// logger.info("about to run hourly.sh"); | ||
|
||
// var hourly = spawn(`${scriptRootPath}/hourly.sh`) | ||
// hourly.stdout.on("data", (data) => { | ||
// logger.info("[hourly.sh]", data.toString().trim()) | ||
// }) | ||
// hourly.stderr.on("data", (data) => { | ||
// logger.info("[hourly.sh]", data.toString().trim()) | ||
// }) | ||
// hourly.on("exit", (code) => { | ||
// logger.info("hourly.sh exitted with code:", code) | ||
// }) | ||
// } | ||
|
||
// var realtime_run = function(){ | ||
// logger.info("about to run realtime.sh"); | ||
|
||
// var realtime = spawn(`${scriptRootPath}/realtime.sh`) | ||
// realtime.stdout.on("data", (data) => { | ||
// logger.info("[realtime.sh]", data.toString().trim()) | ||
// }) | ||
// realtime.stderr.on("data", (data) => { | ||
// logger.info("[realtime.sh]", data.toString().trim()) | ||
// }) | ||
// realtime.on("exit", (code) => { | ||
// logger.info("realtime.sh exitted with code:", code) | ||
// }) | ||
// } | ||
var daily_run = function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we temporarily commented out because we were running the application on this branch, but we revert so that develop includes all the methods to run a full cron task sequence. |
||
logger.info("about to run daily.sh"); | ||
|
||
var daily = spawn(`${scriptRootPath}/daily.sh`) | ||
daily.stdout.on("data", (data) => { | ||
logger.info("[daily.sh]", data.toString().trim()) | ||
}) | ||
daily.stderr.on("data", (data) => { | ||
logger.info("[daily.sh]", data.toString().trim()) | ||
}) | ||
daily.on("exit", (code) => { | ||
logger.info("daily.sh exitted with code:", code) | ||
}) | ||
} | ||
|
||
var hourly_run = function(){ | ||
logger.info("about to run hourly.sh"); | ||
|
||
var hourly = spawn(`${scriptRootPath}/hourly.sh`) | ||
hourly.stdout.on("data", (data) => { | ||
logger.info("[hourly.sh]", data.toString().trim()) | ||
}) | ||
hourly.stderr.on("data", (data) => { | ||
logger.info("[hourly.sh]", data.toString().trim()) | ||
}) | ||
hourly.on("exit", (code) => { | ||
logger.info("hourly.sh exitted with code:", code) | ||
}) | ||
} | ||
|
||
var realtime_run = function(){ | ||
logger.info("about to run realtime.sh"); | ||
|
||
var realtime = spawn(`${scriptRootPath}/realtime.sh`) | ||
realtime.stdout.on("data", (data) => { | ||
logger.info("[realtime.sh]", data.toString().trim()) | ||
}) | ||
realtime.stderr.on("data", (data) => { | ||
logger.info("[realtime.sh]", data.toString().trim()) | ||
}) | ||
realtime.on("exit", (code) => { | ||
logger.info("realtime.sh exitted with code:", code) | ||
}) | ||
} | ||
|
||
/** | ||
Daily reports run every morning at 10 AM UTC. | ||
|
@@ -98,22 +114,24 @@ var calculateNextDailyRunTimeOffset = function(){ | |
} | ||
|
||
logger.info("starting cron.js!"); | ||
// api_run(); | ||
// daily_run(); | ||
// hourly_run(); | ||
// realtime_run(); | ||
// //api | ||
// setInterval(api_run,1000 * 60 * 60 * 24) | ||
// //daily | ||
// setTimeout(() => { | ||
// // Run at 10 AM UTC, then every 24 hours afterwards | ||
// // daily_run(); | ||
// // setInterval(daily_run, 1000 * 60 * 60 * 24); | ||
// //api | ||
// api_run(); | ||
// setInterval(api_run,1000 * 60 * 60 * 24) | ||
// }, calculateNextDailyRunTimeOffset()); | ||
// //hourly | ||
// setInterval(hourly_run,1000 * 60 * 60); | ||
// //realtime | ||
// setInterval(realtime_run,1000 * 60 * 5); | ||
api_run(); | ||
api_ua_run(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. includes new |
||
daily_run(); | ||
hourly_run(); | ||
realtime_run(); | ||
// daily | ||
setTimeout(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bringing in |
||
// Run at 10 AM UTC, then every 24 hours afterwards | ||
daily_run(); | ||
setInterval(daily_run, 1000 * 60 * 60 * 24); | ||
//api | ||
api_run(); | ||
setInterval(api_run,1000 * 60 * 60 * 24) | ||
//ua api | ||
api_ua_run(); | ||
setInterval(api_ua_run,1000 * 60 * 60 * 24) | ||
}, calculateNextDailyRunTimeOffset()); | ||
//hourly | ||
setInterval(hourly_run,1000 * 60 * 60); | ||
//realtime | ||
setInterval(realtime_run,1000 * 60 * 5); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Agency for International Development | ||
export ANALYTICS_REPORT_IDS="ga:68380943" | ||
# USAID Agency | ||
export ANALYTICS_REPORT_IDS="395450427" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We update to use GA4 property codes |
||
export AGENCY_NAME=agency-international-development | ||
export AWS_BUCKET_PATH=data/agency-international-development |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Department of Agriculture | ||
export ANALYTICS_REPORT_IDS="ga:65240995" | ||
# USDA Agency | ||
export ANALYTICS_REPORT_IDS="395461442" | ||
export AGENCY_NAME=agriculture | ||
export AWS_BUCKET_PATH=data/agriculture | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Department of Commerce | ||
export ANALYTICS_REPORT_IDS="ga:66877186" | ||
# DOC Agency | ||
export ANALYTICS_REPORT_IDS="395253935" | ||
export AGENCY_NAME=commerce | ||
export AWS_BUCKET_PATH=data/commerce |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Department of Defense | ||
export ANALYTICS_REPORT_IDS="ga:67120289" | ||
# DOD Agency | ||
export ANALYTICS_REPORT_IDS="395251747" | ||
export AGENCY_NAME=defense | ||
export AWS_BUCKET_PATH=data/defense |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updates to display a GA4 query schema