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
- Navigate to the Google Cloud console.
- Select your Firebase project from the dropdown in the top left corner.
- Search for "Firebase Cloud Messaging API".
- Select Firebase Cloud Messaging API from the marketplace list.

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

Create a custom role that supports message creation
- From the Google Cloud console dashboard, select IAM & Admin under the Quick Access section.

- In the left menu, navigate to the Roles section.

- Click Create custom role.

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

- Click Add Permissions.
- Add only the cloudmessaging.messages.create permission. (For more details, see Google’s instructions for creating a custom role.)

- Click Add Permissions to add the selected permission to the role.
- When ready, create the role by selecting Create.
Create a Google service account
- In the left side menu of the IAM & Admin section, navigate to the Service Accounts tab.
- Click Create service account.

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

- Click Create and continue.
- Click into the Select a role field.

- Select the custom role that you just created. Here, we choose “Test Role,” but select the role you created in the previous section.
- 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
- In the Service Accounts page, click on the email address for the service account that you created in the previous section.

- Navigate to the Keys tab.
- Click Add Key.
- Click Create new key.

- Under Key type, select JSON.

- 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 to upload the key and complete the connection.
Additional resources
- How to set up Android push notifications
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
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.