Skip to content

Commit

Permalink
Merge pull request #76 from jdeboer/dev
Browse files Browse the repository at this point in the history
Prepare for CRAN release
  • Loading branch information
jdeboer authored Jan 7, 2019
2 parents 0b5067b + 0e3a090 commit 4e59709
Show file tree
Hide file tree
Showing 20 changed files with 1,054 additions and 142 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
^_pkgdown\.yml$
^Meta$
^docs$
^.*\.Rproj$
Expand All @@ -21,3 +22,4 @@
client_secret.json
^~/\.google_apis_auth\.RDS$
figure$
^R/WIP/.*$
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Read-and-delete-me
*-Ex.R
.httr-oauth
app_oauth_creds.json
logo.png
logo.xcf
.app_oauth_creds.json
.GOOGLE_APIS_auth.RDS
client_secret.json
R/WIP
~/.google_apis_auth.RDS
revdep/.cache.rds
revdep/data.sqlite
22 changes: 10 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
language: r
r:
- 3.3.0
- release
- devel

- 3.3.0
- release
- devel
sudo: required

cran: http://cran.rstudio.com

r_check_args: "--as-cran"

r_github_packages:
- jimhester/covr
- jimhester/covr
after_success:
- Rscript -e 'covr::codecov()'

- Rscript -e 'covr::codecov()'
warnings_are_errors: true

notifications:
email:
on_success: change
on_failure: change

env:
global:
- GA_CLIENT_ID="91043842526.apps.googleusercontent.com"
- GA_VIEW_ID="ga:117987738"
- secure: CK3nmlKebLuxjR9pw2J4cw1c4fHyxOmns/mRHWv5muyntg4hQCL1Q+V90BkaIajpTpBie/9KaT5MctpYRdZeHRM8TcbfokD7Ux7bGee8ERqVvOQ1w9/Z8TyMtfAP5u4/wBsKFhDkGQYrfs3LuPBJD6YoSEQa7KcwQej1sKYs0wk=
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ganalytics
Title: Interact with 'Google Analytics'
Version: 0.10.5
Version: 0.10.6
Date: 2018-12-22
Authors@R: person(
given = "Johann",
Expand Down Expand Up @@ -44,7 +44,9 @@ Suggests:
testthat,
dplyr,
purrr,
tidyr
tidyr,
spelling,
covr
Collate:
'Bool-generics.R'
'utils.R'
Expand Down Expand Up @@ -107,3 +109,4 @@ LazyData: TRUE
RoxygenNote: 6.1.1
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
Language: en-GB
272 changes: 213 additions & 59 deletions NEWS.md

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions R/GaApiRequest.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,22 @@ app_oauth_creds <- function(appname, creds = NULL) {
creds$client_id <- Sys.getenv(str_c(toupper(appname), "_CONSUMER_ID"))
if (nchar(creds$client_id) == 0) {
creds$client_id <- Sys.getenv("GANALYTICS_CONSUMER_ID")
if (nchar(creds$client_id) > 0) appname <- "GANALYTICS"
if (nchar(creds$client_id) > 0) {
appname <- "GANALYTICS"
} else {
creds$client_id <- Sys.getenv("GA_CLIENT_ID")
}
}
}
if (is.null(creds$client_secret)) {
creds$client_secret <- Sys.getenv(str_c(toupper(appname), "_CONSUMER_SECRET"))
if (nchar(creds$client_secret) == 0) {
creds$client_secret <- Sys.getenv("GANALYTICS_CONSUMER_SECRET")
if (nchar(creds$client_secret) > 0) appname <- "GANALYTICS"
if (nchar(creds$client_secret) > 0) {
appname <- "GANALYTICS"
} else {
creds$client_secret <- Sys.getenv("GA_CLIENT_SECRET")
}
}
}
if (!isTRUE(nchar(creds$client_id) > 0L | nchar(creds$client_secret) > 0L)) {
Expand Down
2 changes: 1 addition & 1 deletion R/Query-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ GaQuery <- function(
if (missing(creds) & is(view, "gaResource")) {
creds <- view$creds
}
if (is(creds, "character")) {creds <- GaCreds(cache = creds)}
if (is(creds, "character")) {creds <- GoogleApiCreds(appname = creds)}
new("gaQuery",
viewId = GaView(view),
dateRange = DateRange(
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ Johann de Boer

<!-- README.md is generated from README.rmd. Please edit that file -->

![logo](https://raw.githubusercontent.com/jdeboer/ganalytics/dev/inst/figures/hexicon-small.png)

# ganalytics
# ganalytics <img src="man/figures/logo.png" align="right" height=140/>

[![Travis-CI Build
Status](https://travis-ci.org/jdeboer/ganalytics.png?branch=master)](https://travis-ci.org/jdeboer/ganalytics)

[![Coverage
status](https://codecov.io/gh/jdeboer/ganalytics/branch/master/graph/badge.svg)](https://codecov.io/github/jdeboer/ganalytics?branch=master)
[![CRAN
status](https://www.r-pkg.org/badges/version/ganalytics)](https://cran.r-project.org/package=ganalytics)
[![Rdoc](http://www.rdocumentation.org/badges/version/ganalytics)](http://www.rdocumentation.org/packages/ganalytics)

Classes and methods for interactive use of the Google Analytics core
Expand All @@ -30,8 +31,6 @@ are also provided for the Google Analytics Management and Google Tag
Manager APIs so that you can, for example, change tag, property or view
settings.

Visit the 'ganalytics' website at: http://jdeboer.github.io/ganalytics/index.html

## Updates

Support for GoogleAnalyticsR integration is now available for segments
Expand Down Expand Up @@ -95,7 +94,7 @@ your Boolean expressions. For example `my_filter <- !bounced &
(completed_goal | transacted)` is a valid structure for a Google
Analytics reporting API filter expression.

You can use query the Google Analytics Management API to obtain details
You can now query the Google Analytics Management API to obtain details
in R about the configuration of your accounts, properties and views,
such as goals you have defined. There are *write* methods available too,
but these have not been fully tested so use with extreme care. If you
Expand Down
10 changes: 3 additions & 7 deletions README.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ knitr::opts_chunk$set(
out.width = "100%"
)
```

![logo](https://raw.githubusercontent.com/jdeboer/ganalytics/dev/inst/figures/hexicon-small.png)

ganalytics
ganalytics <img src="man/figures/logo.png" align="right" height=140/>
==========
[![Travis-CI Build Status](https://travis-ci.org/jdeboer/ganalytics.png?branch=master)](https://travis-ci.org/jdeboer/ganalytics)

[![Rdoc](http://www.rdocumentation.org/badges/version/ganalytics)](http://www.rdocumentation.org/packages/ganalytics)
[![Travis-CI Build Status](https://travis-ci.org/jdeboer/ganalytics.png?branch=master)](https://travis-ci.org/jdeboer/ganalytics) [![Coverage status](https://codecov.io/gh/jdeboer/ganalytics/branch/master/graph/badge.svg)](https://codecov.io/github/jdeboer/ganalytics?branch=master) [![CRAN status](https://www.r-pkg.org/badges/version/ganalytics)](https://cran.r-project.org/package=ganalytics) [![Rdoc](http://www.rdocumentation.org/badges/version/ganalytics)](http://www.rdocumentation.org/packages/ganalytics)

Classes and methods for interactive use of the Google Analytics core reporting, real-time reporting, multi-channel funnel reporting, metadata, configuration management and Google Tag Manager APIs.

Expand Down Expand Up @@ -56,7 +52,7 @@ Multi-channel funnel (MCF) and real-time (RT) queries can now be constructed, bu

Instead of using `Or`, `And`, and `Not`, it is now possible to use familiar R language Boolean operators, `|` (`Or`), `&` (`And`), and `!` (`Not`) instead (thanks to @hadley for suggestion [#2](https://github.com/jdeboer/ganalytics/issues/2)). It is important to keep in mind however that Google Analytics requires `Or` to have precedence over `And`, which is the opposite to the natural precedence given by R when using the `|` and `&` operators. Therefore, remember to use parentheses `(` `)` to enforce the correct order of operation to your Boolean expressions. For example `my_filter <- !bounced & (completed_goal | transacted)` is a valid structure for a Google Analytics reporting API filter expression.

You can use query the Google Analytics Management API to obtain details in R about the configuration of your accounts, properties and views, such as goals you have defined. There are *write* methods available too, but these have not been fully tested so use with extreme care. If you wish to use these functions, it is recommended that you test these using test login, otherwise avoid using the "INSERT", "UPDATE" and "DELETE" methods.
You can now query the Google Analytics Management API to obtain details in R about the configuration of your accounts, properties and views, such as goals you have defined. There are *write* methods available too, but these have not been fully tested so use with extreme care. If you wish to use these functions, it is recommended that you test these using test login, otherwise avoid using the "INSERT", "UPDATE" and "DELETE" methods.

There is also some basic support for the Google Tag Manager API, but again, this is a work in progress so take care with the write methods above.

Expand Down
Empty file added _pkgdown.yml
Empty file.
12 changes: 12 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
patch:
default:
target: auto
threshold: 1%
Loading

0 comments on commit 4e59709

Please sign in to comment.