# Google Cloud Platform (GCP)

{% hint style="warning" %}
**Note**: This guide outlines a reference configuration; specific steps may vary due to provider updates or your organization's security policies. Please share feedback if you encounter any discrepancies that prevent a successful setup.
{% endhint %}

## Set up Google Cloud Storage (GCS) Integration

To enable Open Loyalty to export data directly to your Google Cloud environment, you must create a specific Bucket and a Service Account with the appropriate write permissions.

## **Prerequisites**

* A Google Cloud Platform account with administrative access.
* An active Project (or the ability to create a new one).

## 1. Create a New GCS Bucket

{% stepper %}
{% step %}
Log in to the **Google Cloud Console.**
{% endstep %}

{% step %}
Select an existing **Project** from the top dropdown menu, or create a **New Project**.
{% endstep %}

{% step %}
In the left-hand navigation menu, navigate to **Storage → Cloud Storage → Buckets.**
{% endstep %}

{% step %}
Click **+ Create**
{% endstep %}

{% step %}
Configure the bucket with the following settings:

* **Name your bucket:** Enter a globally unique name (lowercase, no spaces).
  * *Example:* `ol-data-export-bucket`
* **Location type:** Select Region.
* **Location**: Choose the region closest to your operations.
* **Default storage class:** Select Standard.
* **Access control:** Select Uniform (Recommended).
  {% endstep %}

{% step %}
Scroll down and click **Create.**
{% endstep %}
{% endstepper %}

## 2. Create a Service Account

To allow Open Loyalty to send files to your bucket, a service account with a specific private key is required.

{% stepper %}
{% step %}
In the left-hand menu, navigate to **IAM & Admin → Service Accounts**.
{% endstep %}

{% step %}
Click **+ Create Service Account**.
{% endstep %}

{% step %}
**Service account details:**

* **Service account name**: Enter a recognizable name (e.g., `storage-uploader`).
* Click **Create and continue**.
  {% endstep %}

{% step %}
Grant this service account access to project:

* Click the **Select role** field.
* Search for and select: **Storage → Storage Object Admin**.

{% hint style="info" %}
**Note**: This specific role is required as it allows uploading (writing) new objects to the bucket.
{% endhint %}

* Click **Continue**, then click **Done.**
  {% endstep %}
  {% endstepper %}

## 3. Generate the JSON Key

{% stepper %}
{% step %}
In the Service Accounts list, click on the newly created service account (e.g., storage-uploader).
{% endstep %}

{% step %}
Navigate to the **Keys** tab.
{% endstep %}

{% step %}
Click **Add key → Create new key**.
{% endstep %}

{% step %}
Select **JSON** as the key type and click **Create**.
{% endstep %}

{% step %}
A `.json` key file will automatically download to your computer.
{% endstep %}
{% endstepper %}

## 4. Submit Configuration to Open Loyalty

Once the configuration is complete, you must share the credentials with the Open Loyalty team.

{% hint style="danger" %}
**Do not send** the JSON file directly via email.
{% endhint %}

{% stepper %}
{% step %}
Upload the `.json` file (or paste its contents) to a secure file exchange platform (e.g., Bitwarden Send, Proton Drive, or 1Password).
{% endstep %}

{% step %}
Generate a secure link.
{% endstep %}

{% step %}
Send the link to the Open Loyalty team.
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.openloyalty.io/technical-guide/data-exports/set-up-integration/google-cloud-platform-gcp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
