Google Sheets Extension

If you regularly send messages in multiple languages and find copy and pasting your translations into the OneSignal dashboard to be time consuming, then you could try using our Google Sheets extension. This extension allows you to easily translate your message into any language that is compatible with OneSignal and either send it as a single message, or as a separate message for each language.

Downloading the Extension

At present, the Google Sheets Extension is not publicly available. If you are interested in testing our prototype, please reach out to our support team for details.

How to Use this Extension

The OneSignal Multi-Language Message Builder for Google Sheets is designed to allow you to more easily send messages to a large number of different languages, either as one message with multiple languages, or with each language as a separate message.

The extension can only work if you populate the sheet correctly. To help you do this, there is an option in the OneSignal menu to “➕ Add Row Titles”:

Clicking this option will populate the spreadsheet with everything you need to get started, including row titles and an english language column:

Before sending a message, you will need to fill in details for at least the Title and Message, and provide either a list of Segments or Filters. All other options are optional. For each language that you would like to send to, you will need to enter the language code for that country into the top row of the column:

Next, you can either add your own translations or use the “💬 Translate” option in the OneSignal menu to translate your English language options automatically:

Finally, to send the message, click on the “🚀 Send Push Notification” option in the OneSignal Menu and follow the on-screen instructions (please see the separate help guide for how to send :

You will be required to enter your App Id and API key each time you send a message (these will not be saved for security reasons). You can find your OneSignal App Id and API key in the “Keys & IDs” section of your OneSignal account:

After sending is complete, you will be presented with the server response code, notification ID and a link to the delivery page for the message:

Translating Messages

To translate a message, you must first have filled out at least the “en” title and message.

📘

The First column must always be the “en” language code, regardless of whether the message you wish to translate from is in English. This is because OneSignal uses the values of your “en” translation as the default language for users that are using languages that your message does not have a value for.

There are two options for translating messages:

“💬 Translate” will translate the title, subtitle, and message into the corresponding languages for whichever language codes you have entered. For example, if you have entered the language codes “fr”, “es”, and “de”, these will be translated into French, Spanish, and German respectively:

You will first be asked if you are translating from English or not, if not, you will be required to enter the language code of the language you are translating from.

Next you will be shown which translations are currently missing and asked whether you would like to proceed. If you click yes, you will be alerted to the translations that were completed and the translations will be placed in the sheet automatically:

“🌍 Add All Compatible Translations” will automatically translate the title, subtitle, and message values in the “en” column into all translations that are compatible with OneSignal.

📘

This option will automatically overwrite any and all translations that are currently in the sheet, so if you wish to translate any languages manually, please do so after selecting this option. You will be warned about this every time you choose this option.

For this option, you will not be able to translate from another language and your “en” language column must contain the English translation of your message. If you agree to the warning message about your existing translations being overwritten, the process will begin immediately and, when complete, an alert will appear telling you that the message has been translated into 42 languages and the translations will populate the sheet automatically.

Sending a Message

Step 1: Populate the Spreadsheet

To send a message, first populate the spreadsheet in the following way:

Row NumberContent
1Language Code: The language codes for each translation that you wish to send.
2Title: The title for the message in each language.
3Subtitle: The subtitle in each language (note that this will only be shown on iS 10+ devices)
4Message: The message for each language
5Image URL: The image URL
6Launch URL: The click through URL
7Segments: A comma separated list of all of the segments you wish to include in the message
8Filters: An array of filters that you wish to send to. Please see the following documentation for guidance: https://documentation.onesignal.com/reference/create-notification#formatting-filters
9Scheduled Send Date: A date to schedule the message to send in the future, in the format YYYY-MM-DD HH:MM:SS TMZ
10Buttons: An array containing buttons objects. Please see the “Sending Buttons” option of this help guide or the following documentation for guidance on the format of this option: https://documentation.onesignal.com/reference/push-channel-properties#action-buttons
11Web Buttons: An array containing web buttons objects. Please see the “Sending Buttons” option of this help guide or the following documentation for guidance on the format of this option: https://documentation.onesignal.com/reference/push-channel-properties#action-buttons
12Additional Data: A JSON object containing key/value pairs for additional data. Please see the following documentation for guidance on the format of this option: https://documentation.onesignal.com/reference/push-channel-properties#attachments

📘

Column A should contain row titles only and no actual message data. To populate this column, please click on the “➕ Add Row Titles” in the OneSignal menu.

Step 2: Click OneSignal in the Menu

Then click OneSignal in the menu and click “🚀 Send Push Notification”. You will be prompted to enter both your OneSignal App ID and API key.

Step 3: Confirm the API Request

After this, you will be shown the API request and asked to confirm. Confirming will send the message.

Step 4: Check for Confirmation or Error Messages

After sending the message, you will have a window pop up confirming that it has been sent, giving an option to click into the message delivery page and displaying the details of the server response. If an error occurs, you will be presented with the error code and reason for failure.

Sending Buttons

Sending buttons requires that you create an array of JSON objects which contain the details for your buttons. There are two types of buttons: “Buttons” refers to buttons that will be displayed on Android 4.1+ and iOS 8.0+ devices, whereas “Web Buttons” refer to buttons that will be displayed in web browsers (Chrome 48+).

Buttons must be formatted so that you have an array of JSON objects, one object for each button, where each object has a key/value pair for “id”, “text”, and “icon”. For example:
[{"id": "id1", "text": "first button", "icon": "ic_menu_share"}, {"id": "id2", "text": "second button", "icon": "ic_menu_send"}]

Web Buttons are similar, but require an additional key/value pair for “url” . For example:
[{"id": "like-button", "text": "Like", "icon": "http://i.imgur.com/N8SN8ZS.png", "url": "https://yoursite.com"}, {"id": "read-more-button", "text": "Read more", "icon": "http://i.imgur.com/MIxJp1L.png", "url": "https://yoursite.com"}]

Translating Buttons

To translate your buttons, click on the “🤖 Advanced Options” option in the OneSignal menu, then select “🔡 Translate Buttons”. Only the values for each “text” option will be translated.

You will first be asked if you are translating from English or not, if not, you will be required to enter the language code of the language you are translating from.

Next you will be shown which translations are currently missing and asked whether you would like to proceed. If you click yes, you will be alerted to the translations that were completed and the translations will be placed in the sheet automatically:

📘

OneSignal does not currently support translations of buttons within a single message. However, using the “🎯 Send To Languages Separately” option under the “🤖 Advanced Options” section of the menu allows you to send a message for each language, meaning that you can send the appropriate button translation in each message.

Sending to Languages Separately

For most use cases, sending a single message with all of the necessary translations within it will be sufficient. However, if you wish to send a language-specific option which is not possible in a single message, then you can use the “🎯 Send To Languages Separately” option under “🤖 Advanced Options” to send a separate message for each language option.

🚧

It is not possible for the extension to filter your users by language automatically using this option. You must therefore ensure that you filter each language option correctly yourself. Not doing so will result in all users in your chosen segment/filters receiving the message multiple times, once for each language. You can filter by language using this option either by sending to language specific segments, or by including the language key/value pair in your filters list.

To send to languages separately, first populate the spreadsheet for each language. In this instance, it is necessary to include a value for each option you would like to send to each language under every column:

When you are satisfied that all columns have been filled correctly, select the “🎯 Send To Languages Separately” option under “🤖 Advanced Options” to send a separate message for each language option. You will then be reminded about the need to fill in each column and ensure that you have filtered correctly and asked if you would like to continue. If you select yes, you will be asked for your App ID and API Key and then the messages will begin to be sent.

Once completed you will see an alert on the screen confirming and a new sheet will open. In this sheet the extension will populate a row for each language, providing the server response status and code, the details from the server response, the Notification ID for each message (if successfully sent) and a link to the dashboard for each successful message: