Google Sheets Integration & Rules
The Google Sheets Integration & Rules allow you to add users and their user information to a Google Sheet when the user triggers a user event.
A few real world examples are:
- When a user converts, they are added to a Google Sheet you created for new users
- When a user completes a specific event on your site’s user journey, they are added the same (or a different) Google Sheet.
To set up your Google Sheets integration, you will need to select/set up a project, enable the Google Sheets API for it, create a service user, and download your key information JSON file.
- Log in to the Google Cloud Console:
- If you have not already created a Project, click Select a Project, then New Project. If you already have a project you know that you want to use, select it and then skip to the next step.
- For Project name, enter your organization’s name.
- For Organization, select your organization.
- For Location, select your organization.
- Click Create.
- At the top of the page, confirm that you are in the right project. If you are not, select the project from the dropdown at the top of the page in Google Cloud Console.
- In the top left menu, select APIs & Services.
- Click Enable APIs and Services.
- Under Google Workspace, select Google Sheets API.
- Enable Google Sheets API.
- In the top left menu, select IAM & Admin, then Service Accounts.
- At the top of the page, click Create Service Account.
- Enter an account name of your choice, then click the Create and Continue button.
- Add the Owner role to the user, then click Done.
- Click on your newly created user, and then copy and store the service account email address for the Rules setup below.
- Go to the Keys tab and click Add Key > Create new key.
- Choose JSON, then click Create. The key will automatically download, and will be used in the next steps.
To create your Mailchimp Integration in Bread & Butter, follow these steps:
- Log in to your Bread & Butter Dashboard at: https://app.breadbutter.io
- Click Logic on the left side menu.
- Scroll down to the Integrations section, and click Create New.
- In the dialog, select Google Sheets.
- Choose a descriptive name for the Integration (note: this can be anything, and you can change the name later).
- Open the JSON file you downloaded in the previous steps, and paste the content into the Google Sheets JSON file data field.
- Click Save & Close.
To set up a Rule that uses your Google Sheets integration, please follow these steps:
First, prepare your spreadsheet, then grant your service account user access to it:
- Find or create your spreadsheet in Google Drive/Googe Sheets.
- In the top row, add headings for the Bread & Butter fields you want to add. For a list, see Integration Mappings.
- At the top right, click on Share.
- In the Share dialog, add the service account email address that you created in the Integrations section above. Give them Editor permissions, and Share the spreadsheet.
Then, complete the following in Bread & Butter:
- Log in to your Bread & Butter Dashboard at:
- Click Logic on the left side menu.
- Scroll down to the Rules section, and click Create New.
- Choose the Google Sheets Integration that this Rule will use.
- Then, choose the User Event or System Event that will trigger this Rule.
- Give the rule a name so you can identify it in the Rules list.
- Enter the Spreadsheet ID of the Google Sheet you want to use. Note: You can find this in the URL of the spreadsheet.
- Enter the Sheet Name for the specific sheet in your spreadsheet that you want to use. This is the name that appears at the bottom of the spreadsheet, and is “Sheet1” by default.
- Click Get Mappings.
- The column headers from your spreadsheet will appear. Choose the Bread & Butter data that you want to map to each column.
- Click Save & close.
Your rule is now set up and ready to go. Whenever a user triggers the user event via your website, the Rule will be triggered and the user’s information will be added to your Google Sheet.