Skip to content

Commit

Permalink
Merge branch '257b-usage-tracking', issue #257
Browse files Browse the repository at this point in the history
  • Loading branch information
smalers committed Mar 30, 2023
2 parents 48e5695 + 856ed0a commit 3f47dc6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build-util/copy-to-co-dnr-gcp.bash
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ updateIndex() {
read -p "Do you want to update the GCP index and usage index files [Y/n]? " answer
if [ -z "${answer}" -o "${answer}" = "y" -o "${answer}" = "Y" ]; then
${scriptFolder}/create-gcp-tstool-index.bash
${scriptFolder}/create-gcp-tstool-usage-index.bash
# TODO smalers 2023-03-30 there are technical and possibly legal issues:
# - see: https://stackoverflow.com/questions/75890133/google-analytics-4-for-desktop-java-application
#${scriptFolder}/create-gcp-tstool-usage-index.bash
fi
}

Expand Down
2 changes: 1 addition & 1 deletion build-util/create-gcp-tstool-usage-index.bash
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ uploadIndexHtmlFile() {

echo "
<!-- Start Google Analytics 4 property. -->
<script async src=\"https://www.googletagmanager.com/gtag/js?id=TAG_ID\"></script>
<script async src=\"https://www.googletagmanager.com/gtag/js?id=G-PTJLXFDPDL\"></script>
<script>
window.dataLayer = window.dataLayer || [];
Expand Down
9 changes: 9 additions & 0 deletions src/DWR/DMI/tstool/TSToolMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -2320,10 +2320,19 @@ public void run() {

/**
* Do a GET request on the OpenCDSS website to cause Google Analytics to track a TSTool usage.
* TODO smalers 2023-03-30 This needs more work.
* See: https://stackoverflow.com/questions/75890133/google-analytics-4-for-desktop-java-application
* @param runMode the TSTool run mode, to understand how TSTool is being called
*/
private static void trackUsage ( String runMode ) {
String routine = TSToolMain.class.getSimpleName() + ".trackUsage";

boolean doTracking = false;
if ( !doTracking ) {
// TODO smalers 2023-03-30 figure out a good solution for tracking.
return;
}

// Operating system.
String os = "unknown";
if ( IOUtil.isUNIXMachine() ) {
Expand Down

0 comments on commit 3f47dc6

Please sign in to comment.