In order to export Analytics data to a Google Cloud Storage Bucket an `Analytics Output` needs to be configured within the Bitmovin API. This guide will walk you through the required steps.

## Pre-requisites

To do so you'll need the following pre-requisites:

  • A GCS Bucket

  • A GCE Service Account with Read/Write Privileges to the Bucket

  • The GCE Service Account JSON Credentials

To create a GCS Bucket please follow the official Google Documentation on [creating buckets](🔗).

To create a Service Account follow the official Google Documentation on [creating and managing service accounts](🔗)

## Retrieving GCE Service Account Credentials

In order to configure the GCS Analytics Output via the API you first have to create Service-Account Credentials which the Bitmovin Analytics Exporter will use to write to your bucket.

To do so please visit your Google Cloud Console and navigate to the Service-Account you want to create credentials for and select "Add Key" and generate a JSON Key like shown in the following Screenshots.

## Creating the Analytics Output Resource

Next you simply have to create the [analytics output resource](🔗) using either our OpenAPI Clients or CURL on `POST /v1/analytics/outputs/gcs-service-account`:

**Important**: Make sure to correctly encode the `credentials.json` as whitespaces and newlines in the PEM Key are relevant.

**Important**: Make sure you are creating this resource in the appropriate Organization if you have been invited into a Multi-Tenant Organization. Your personal API Key will by default create all resources in your user's organization and not in the organization you have been invited to. You can pass the `X-Tenant-Org-Id` HTTP Header or use the `withTenantOrgId()` API to indicate which Organization your API call is targetting (see [Using an API SDK with different Organisations](🔗)).

The response will contain a `id` for the newly created Output which you can then use to trigger a Analytics Export.

Now that you have an GCS role-based Output for Bitmovin Analytics available, you can [start exporting data](🔗) to it.