Skip to main content

Google Analytics V4 API Compatibility Library

Project description

# Google Analytics Reporting V4 Compatibility Library

A library for converting Google Analytics Core Reporting API V3 request to Analytics Reporting API V4 requests.

## Installation

$ pip install –upgrade gav4

## Typical usage example

There are two methods of using the gav4 library. You can apply the library to an authorized Google Analytics Service object, which exposes a get method that operates much like the current Core Reporting API V3.

import gav4

# Apply the gav4 get method to the authorized service object. gav4.apply_gav4(analytics)

# Call the gav4_get method with a V3 request and get a V3 response. v3_response = analytics.gav4_get(v3_request).execute()

Alternatively you can convert the requests and responses directly.

# Convert a V3 request into a V4 request. v4_request = gav4.convert_request(v3_request)

# Call the V4 API. v4_response = analytics.reports().batchGet(body=v4_request).execute()

# Convert the V4 API response into a V3 response. v3_response = gav4.convert_report(v4_response.get(‘reports’, [])[0])

## Testing

Run the tests with the following command:

python setup.py tests

This may require you to install the nose library – pip install nose.

## Contributing

  1. Please sign one of the contributor license agreements below.

  2. Fork the repository, develop and test your code changes, add docs.

  3. Make sure that your commit messages clearly describe the changes.

  4. Send a pull request.

### Contributor License Agreements

Before we can accept your pull requests you’ll need to sign a Contributor License Agreement (CLA):

You can sign these electronically (just scroll to the bottom). After that, we’ll be able to accept your pull requests.

### Code reviews All submissions, including submissions by project members, require review. We use Github pull requests for this purpose.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gav4-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

File details

Details for the file gav4-0.1.0.tar.gz.

File metadata

  • Download URL: gav4-0.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gav4-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a3581983f60df503bc8b3f4ba3d282844283b395eebd82a447a58d22b844ab22
MD5 6218840d1ca7dc8d40881a023f405cd0
BLAKE2b-256 37a21491660fffa44d7a2a3580694e05f7b539aea1f8ebdfaa3ce4640d60317d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page