---
title: "How to create Google service account to enable push notifications"
description: "Learn how to set up your Google service account and enable Firebase Cloud Messaging so you can send Klaviyo push notifications to Android devices."
canonical_url: "https://help.klaviyo.com/hc/en-us/articles/19893982562203"
markdown_url: "https://help.klaviyo.com/hc/en-us/articles/19893982562203.md"
locale: "en-us"
category: "Push Notifications"
section: "Getting started with push notifications"
updated: "2026-10-25"
---

# How to create Google service account to enable push notifications

## You will learn

Learn how to set up your Google service account and enable Firebase Cloud Messaging so you can send Klaviyo push notifications to Android devices. 

## Before you begin

Before following the steps below, you must have an existing Firebase project for your Android app. Use the same project throughout this setup.

You need Google Cloud permissions to enable APIs, create custom roles and service accounts, assign the role to the service account, and create service account keys. If you cannot complete these actions, ask your Google Cloud administrator for access or help with setup.

## Enable the Firebase Cloud Messaging API

1. Navigate to the [Google Cloud console](https://console.cloud.google.com/welcome). 

2. Select your Firebase project from the dropdown in the top left corner.

3. Search for "Firebase Cloud Messaging API".

4. Select **Firebase Cloud Messaging API** from the marketplace list.




![Searching for the Firebase Cloud Messaging API](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/28ec1a17730181ec4fff288b3a05a9c8e7fe3301-1522x1678.jpg?auto=format)

5. Click **Enable** to enable the API for your project. If the API is already enabled, continue to the next section.



![Page to enable Firebase Cloud Messaging API](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/f3e543ca4e645fdfb06393a718a3d08223a19c71-547x248.png?auto=format)

## Create a custom role that supports message creation

1. From the [Google Cloud console dashboard](https://console.cloud.google.com/welcome), select **IAM & Admin** under the *Quick Access* section.




![All Quick Access links, with only the IAM & Admin option highlighted](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/e4ea1744bb95a4ede63a5869f125cd0463e29b00-2222x1234.jpg?auto=format)

2. In the left menu, navigate to the **Roles** section. 




![Roles highlighted in the left sidebar](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/c04aa2f7f9a65b0327ebc62f5b1d97f38eb80dcb-254x651.png?auto=format)

3. Click **Create custom role**.



![Roles page, where Create role is shown in the upper left](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/0cc58b2e58211c9817d05abfdf15435efe8f9a4d-1999x1213.jpg?auto=format)

4. Enter a **Title**, **Description**, **ID**, and **Role launch stage** for the role. The ID cannot be changed after the role is created.



![Create Role window](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/a4a739baa91ad23230adf582d94b31801c2bb625-1092x1596.jpg?auto=format)

5. Click **Add Permissions**.

6. Add only the *cloudmessaging.messages.create* permission. (For more details, see Google’s instructions for [creating a custom role](https://cloud.google.com/iam/docs/creating-custom-roles#creating).)




![Searching for the correct role permission](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/7f858108f5716b104cd8e6ed34626cc46c1d0150-1106x1258.jpg?auto=format)

7. Click **Add Permissions** to add the selected permission to the role.

8. When ready, create the role by selecting **Create**. 



## Create a Google service account

1. In the left side menu of the [IAM & Admin section](https://console.cloud.google.com/iam-admin/iam), navigate to the *Service Accounts* tab.

2. Click **Create service account**.



![Button to create a Google service account](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/a31301eab67af1a58a5908fb91c4e0960d3be1f5-1316x258.png?auto=format)

3. Fill out the *Service account name* and *Service account description* (optional) fields.




![First step of the wizard to create a new service account](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/010e82716997660bf45c722c557980eaaab4fcef-1668x1224.png?auto=format)

4. Click **Create and continue**.

5. Click into the *Select a role* field.




![Adding a role to a new service account](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/a448e510151c009c4d54a7de041189bdfac62ba5-1151x1130.png?auto=format)

6. Select the custom role that you just created. Here, we choose “Test Role,” but select the role you created in the previous section.

7. Click **Continue**. Leave the optional service account user and admin access fields blank, then click **Done** to finish creating the service account.



## Generate a service account key

1. In the [Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts) page, click on the email address for the service account that you created in the previous section.




![Service accounts page, where the accounts are blurred for security purposes](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/1133fdfc1e8fc1eabff35981fbd55add0e989b6a-1490x689.png?auto=format)

2. Navigate to the **Keys** tab.

3. Click **Add Key**.

4. Click **Create new key**.




![Add key dropdown, when the Create new key option is highlighted](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/50d97a3691c25e1f010d596b988c37887046dd2a-1999x842.jpg?auto=format)

5. Under *Key type*, select **JSON**.




![Modal to select the key type when JSON is selected](https://cdn.sanity.io/images/6ct6b26e/help-center-prod/b1d62869b325d3e9640511d4e87306f394b2ed5e-1116x714.jpg?auto=format)

6. Click **Create** to download the service account key file.



Store the downloaded file securely where you can find it when setting up Android push notifications in Klaviyo. You cannot download this key file again. The JSON below shows an example of the file’s format; upload the file Google downloads, using your actual credentials.

`{ "type": "service_account", 
"project_id": "PROJECT_ID", 
"private_key_id": "KEY_ID", 
"private_key": "-----BEGIN PRIVATE KEY-----\nPRIVATE_KEY\n-----END PRIVATE KEY-----\n", 
"client_email": "SERVICE_ACCOUNT_EMAIL", 
"client_id": "CLIENT_ID", 
"auth_uri": "https://accounts.google.com/o/oauth2/auth", 
"token_uri": "https://accounts.google.com/o/oauth2/token", 
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", 
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/SERVICE_ACCOUNT_EMAIL" }`

## Outcome

Your Google service account now has the messaging role and a downloaded JSON key. Continue with [setting up Android push notifications in Klaviyo](https://help.klaviyo.com/hc/en-us/articles/14750928993307.md) to upload the key and complete the connection.

## Additional resources

- [How to set up Android push notifications](https://help.klaviyo.com/hc/en-us/articles/14750928993307.md)
  Learn how to set up push notifications for Android in your Klaviyo account. After you've completed the steps in this article you'll be able to send push notifications in your flows and campaigns.
- [How to set up iOS push notifications](https://help.klaviyo.com/hc/en-us/articles/360023213971.md)
  Learn how to set up push notifications in your Klaviyo account. After you've completed the steps in this article you'll be able to send push notifications in your flows and campaigns.
