{"id":20038221,"url":"https://github.com/jjcosgrove/php-gaoauth2","last_synced_at":"2025-06-30T16:39:25.059Z","repository":{"id":31650703,"uuid":"35216016","full_name":"jjcosgrove/php-gaoauth2","owner":"jjcosgrove","description":"A simple PHP OAuth2 helper class for use with the Google Analytics API","archived":false,"fork":false,"pushed_at":"2024-07-23T10:03:54.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T18:52:21.798Z","etag":null,"topics":["authentication","google","oauth2","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jjcosgrove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-07T11:22:11.000Z","updated_at":"2024-07-23T10:03:57.000Z","dependencies_parsed_at":"2024-11-13T10:39:58.225Z","dependency_job_id":null,"html_url":"https://github.com/jjcosgrove/php-gaoauth2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjcosgrove%2Fphp-gaoauth2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjcosgrove%2Fphp-gaoauth2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjcosgrove%2Fphp-gaoauth2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjcosgrove%2Fphp-gaoauth2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjcosgrove","download_url":"https://codeload.github.com/jjcosgrove/php-gaoauth2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241468150,"owners_count":19967800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","google","oauth2","php"],"created_at":"2024-11-13T10:26:52.084Z","updated_at":"2025-03-02T06:24:41.019Z","avatar_url":"https://github.com/jjcosgrove.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gaOAuth2\n\ngaOAuth2 is a simple helper class for working with the Google Analytics API.\n\nRelease information:\n* Current Version: 1.0.0\n\n## Setup\n\n* Place the files within your desired webroot.\n* Configure the gaOAuth2 object via constructor (see Google GA API docs for help).\n* Ensure permissions are correct for read/write by your server (for storing credentials).\n* Visit the page - if it is your first run then you will be prompted to authenticate.\n* Once authenticated, your GA API credentials will be stored for future use and refreshed when needed.\n\n## Usage\n\n```php\nrequire('gaOAuth2/gaOAuth2.php');\n\n$myGAOAuth2Config = array(\n    'gaClientId'                =\u003e 'YOUR_CLIENT_ID_GOES_HERE',\n    'gaClientSecret'            =\u003e 'YOUR_CLIENT_SECRET_GOES_HERE',\n    'gaRedirectURI'             =\u003e 'YOUR_DOMAIN_GOES_HERE',\n    'gaOAuth2CredentialsJSON'   =\u003e 'YOUR_CREDENTIALS_FILENAME_GOES_HERE'\n);\n\n$myGAOAuth2 = new gaOAuth2($myGAOAuth2Config);\n$myGAOAuth2-\u003eAuthorize();\n\n$myGAQuery  = '?ids=ga:123456789';\n$myGAQuery .= '\u0026metrics=ga:pageviews,ga:uniquePageviews,ga:avgTimeOnPage';\n$myGAQuery .= '\u0026filters=ga:country==United Kingdom';\n$myGAQuery .= '\u0026start-date=2015-04-01';\n$myGAQuery .= '\u0026end-date=2015-05-07';\n$myGAQuery .= '\u0026max-results=50';\n\n$myGAOAuth2Response = $myGAOAuth2-\u003eRequest($myGAQuery);\n```\n\nThe included 'index.php' file provides a rough framework/example to get you started.\n\n## Contact\n\nPlease send feedback, comments and suggestions to my email address which can be found within the gaOAuth2 class definition.\n\nBugs or feature requests/contributions can be done via:\n\n[https://github.com/jjcosgrove/gaOAuth2/issues](https://github.com/jjcosgrove/gaOAuth2/issues)\n\n## Authors\n\n* Just me for now.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjcosgrove%2Fphp-gaoauth2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjcosgrove%2Fphp-gaoauth2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjcosgrove%2Fphp-gaoauth2/lists"}