Skip to content

Commit

Permalink
Add stuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
cansavvy committed Feb 22, 2024
1 parent 88f70a4 commit 4d8698c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/refresh-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ jobs:
token: ${{ secrets.METRICMINER_GITHUB_PAT }}

- name: Refresh CRAN
run: Rscript refresh-scripts/refresh-cran.R --cran_packages ${{needs.yaml-check.outputs.cran_packages}}
run: |
echo ${{needs.yaml-check.outputs.cran_packages}}
Rscript refresh-scripts/refresh-cran.R --cran_packages ${{needs.yaml-check.outputs.cran_packages}}
- name: Commit CRAN data
run: |
Expand Down Expand Up @@ -117,7 +119,9 @@ jobs:
env:
METRICMINER_GOOGLE_ACCESS: ${{ secrets.METRICMINER_GOOGLE_ACCESS }}
METRICMINER_GOOGLE_REFRESH: ${{ secrets.METRICMINER_GOOGLE_REFRESH }}
run: Rscript refresh-scripts/refresh-ga.R --ga_property_ids ${{needs.yaml-check.outputs.ga_property_ids}}
run: |
echo ${{needs.yaml-check.outputs.ga_property_ids}}
Rscript refresh-scripts/refresh-ga.R --ga_property_ids ${{needs.yaml-check.outputs.ga_property_ids}}
- name: Commit GA data
run: |
Expand Down
9 changes: 7 additions & 2 deletions refresh-scripts/refresh-ga.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ option_list <- list(
opt_parser <- optparse::OptionParser(option_list = option_list)
opt <- optparse::parse_args(opt_parser)

ga_metrics <- get_all_ga_metrics(property_ids = opt$ga_property_ids)

saveRDS(ga_metrics, file.path(output_dir, "ga_metrics.RDS"))
metrics <- get_ga_stats(opt$ga_property_ids, stats_type = "metrics")
dimensions <- get_ga_stats(opt$ga_property_ids, stats_type = "dimensions")
link_clicks <- get_ga_stats(opt$ga_property_ids, stats_type = "link_clicks")

saveRDS(metrics, file.path(output_dir, "ga_metrics.RDS"))
saveRDS(dimensions, file.path(output_dir, "ga_dimensions.RDS"))
saveRDS(link_clicks, file.path(output_dir, "ga_link_clicks.RDS"))

sessionInfo()

0 comments on commit 4d8698c

Please sign in to comment.