> For the complete documentation index, see [llms.txt](https://docs.ecosuite.io/user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecosuite.io/user-guide/orgs/google-integration/getting-started/self-hosted.md).

# Self Hosted

Self hosting your own Google integration for use within your Ecosuite Org

Some of Ecosuite's services require a Google integration to hook into your own Google cloud infrastructure.

What you'll need is to provide a functioning [service account](https://cloud.google.com/iam/docs/service-account-overview). You will then go into your organization preferences and update the Google integration section with your service account **private key** (an RSA private key), as well as the generated service account **client email**.

1. Follow the [provided Google Cloud documentation ](https://cloud.google.com/iam/docs/service-accounts-create)to create your service account.

The gist of it is:

* Click `IAM & Admin`
* On the left pane, click `Service Accounts`
* Click `Create service account`
* Create the account and you'll get an email for that service account (e.g `xyz-abcd@username.iam.gserviceaccount.com`)
* Click on the email from the menu, then head to the `KEYS` tab, create a new key: `ADD KEY --> Create new key` (choose JSON).

{% hint style="info" %}
The private key should look something like this:

```
-----BEGIN RSA PRIVATE KEY-----
MIIBOgIBAAJBAKj34GkxFhD90vcNLYLInFEX6Ppy1tPf9Cnzj4p4WGeKLs1Pt8Qu
KUpRKfFLfRYC9AIKjbJTWit+CqvjWYzvQwECAwEAAQJAIJLixBy2qpFoS4DSmoEm
o3qGy0t6z09AIJtH+5OeRV1be+N4cDYJKffGzDa88vQENZiRm0GRq6a+HPGQMd2k
TQIhAKMSvzIBnni7ot/OSie2TmJLY4SwTQAevXysE2RbFDYdAiEBCUEaRQnMnbp7
9mxDXDf6AU0cN/RPBjb9qSHDcWZHGzUCIG2Es59z8ugGrDY+pxLQnwfotadxd+Uy
v/Ow5T0q5gIJAiEAyS4RaI9YG8EWx/2w0T67ZUVAw8eOMB6BIUg0Xcu+3okCIBOs
/5OiPgoTdSy7bcF9IGpSE8ZgGKzgYQVZeN97YE00
-----END RSA PRIVATE KEY-----

You will want to make sure that you use the newline escape where there are
newlines. For example:

-----BEGIN RSA PRIVATE KEY-----\nMIIBOgIBAAJBAKj34GkxFhD90vcNLYLInFEX6Ppy1tPf9Cnzj4p4WGeKLs1Pt8Qu\nKUpRKfFLfRYC9AIKjbJTWit+CqvjWYzvQwECAwEAAQJAIJLixBy2qpFoS4DSmoEm\no3qGy0t6z09AIJtH+5OeRV1be+N4cDYJKffGzDa88vQENZiRm0GRq6a+HPGQMd2k\nTQIhAKMSvzIBnni7ot/OSie2TmJLY4SwTQAevXysE2RbFDYdAiEBCUEaRQnMnbp7\n9mxDXDf6AU0cN/RPBjb9qSHDcWZHGzUCIG2Es59z8ugGrDY+pxLQnwfotadxd+Uy\nv/Ow5T0q5gIJAiEAyS4RaI9YG8EWx/2w0T67ZUVAw8eOMB6BIUg0Xcu+3okCIBOs\n/5OiPgoTdSy7bcF9IGpSE8ZgGKzgYQVZeN97YE00\n-----END RSA PRIVATE KEY-----
```

{% endhint %}

* Go to `APIs and Services` and click on `Library`. Enable the **Google Sheets API** and **Google Docs API**.

### Using templates

Many of our google integrations use **templates** when importing/exporting data.

To provide your own template, you must provide the **id** of the document you wish to use.

<figure><img src="https://3629832110-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYtoTiPa31rO0d5wf1iTW%2Fuploads%2FsqU4uO6GkFvMg2eCRAAQ%2FScreenshot%20from%202024-06-06%2016-20-01.png?alt=media&amp;token=7b5ed352-c13a-4c20-9836-8e18dfd43549" alt=""><figcaption><p>An example spreadsheet using Google Sheets.</p></figcaption></figure>

You can find the ID following the **/d/** inside the URL.

After you have created a template, the only thing you will have to do is to make sure that you **share** the document with your service account email address to make sure that it has permissions to access it.
