Importing External Data from Google Sheets

Google Sheets is an external data source. You can import data from spreadsheets and use it to build personalized recommendations in emails or segment contacts. Follow the manual to connect tables to your account and set up data substitution in emails.

šŸ“˜

Note

You can connect more than one Google Sheets data source to the same account — there's no limit on the number of connections. Set each one up separately by repeating the steps below with a different spreadsheet link and a unique data source name.

Create New Connection

  1. Go to your personal profile → Settings → Data Sources, click New data source and select External data sources.
Data sources page showing the account Settings menu open and the New data source dropdown with External data source highlighted.
  1. Select Google Sheets.
Where is your data? popup listing BigQuery, PostgreSQL, Google Sheets, and HTTP request, with Google Sheets highlighted.
  1. Enter a name and description and insert the link to the corresponding Google Spreadsheet.
🚧

Important

  • The name may contain only Latin letters (A–Z, a–z), digits (0–9), and the underscore _.
  • The name cannot start with a digit.
  • The use of spaces or special characters is not allowed.
Google Sheets data source form with name and description fields and the Shareable link tab showing setup instructions.

Make sure that:

  • The file is accessed by anyone with the link, without Google authorization required.
Google Sheets sharing dialog with Anyone with the link access set to Viewer, highlighted.
  • The first line of the sheet contains headers in Latin.
Google Sheet with the header row highlighted: Name, Link, Image, Old Price, New Price, Expiry Date.
  • The data you will use is contained in the first sheet (but you can use several sheets for different language versions of the message).
Google Sheet showing product data with the Sheet1 tab highlighted at the bottom.

For multilingual messages, name the file sheets with the corresponding language codes according to ISO 639-1 (e.g., en) or RFC 5646 for dialects (e.g., es-MX).

šŸ“˜

Note

Multilingualism in messages is not supported for all dialects, if you did not find the one you need, please contact our support at [email protected].

Google Sheet with language-coded tabs en, es, and de, with the en tab highlighted.

Specify the default language for the message this data source will be used in. If the default language is not specified, the content in the language of the first sheet will be used in the message.

  1. Click Refresh data. Data from the spreadsheet will be available for preview. By default, only the first 10 lines are previewed.
Data source form with the Refresh data button highlighted above a data preview table of products.
  1. Click Advanced settings to specify the number of recommended items or languages that will be displayed in the message. It will not be sent if the quantity of products in the feed doesn’t match the specified range.

  2. Click Save. The created data source will be available in the general list. To remove it, click three dots on the right → Delete.

Data sources list showing the Data_export source with its dropdown menu open and Delete option highlighted.

If you need to edit the data (for example, in case of a typo or no longer valid prices), make necessary edits to the Google Spreadsheet, and click Refresh data in the corresponding data source. Changes will be applied immediately.

Data source form showing the Refresh data button, language tabs, and a preview table of product data below.

How to Add Data from Google Spreadsheet to an Email

The data is added to the email via Velocity.

  1. In Messages → Messages, select an email with configured dynamic modules or create a new one.

  2. Click the stripe with product cards, click Code editor and insert the code with the corresponding data source as shown below.

Email editor with the Stripe: Content block selected and the Code Editor icon highlighted in the toolbar, code editor panel open below.
  1. In the stripe that will be used to products, add the following prefix before each variable.
<!--#foreach($item in $Products)-->
Code editor showing the #foreach($item in $Products) prefix line highlighted in the product stripe code.
  1. Make sure the stripe with dynamic content ends with the code <!--#end-->.
Code editor showing the closing #end code line highlighted at the bottom of the product stripe.
  1. Specify product parameters from the spreadsheet (name, link, image and prices here) and add their variables to each product card:
  • $!item.Name
  • $!item.Link
  • $!item.Image
  • $!item.OldPrice
  • $!item.NewPrice
Google Sheet with the header row highlighted: name, link, old price, new price, expiry date, image.
  1. To test whether the product data is inserted correctly, send a test email.
Email editor with the Test button highlighted, side panel showing message name, subject line, and sender details.

If you’ve set everything right, the data from the website will be added at the moment of the launch, and the email would look as follows:

Completed birthday email showing a cake photo, discount message, and three product cards with prices and Buy buttons.

You can change the data in the spreadsheet and refresh the data source, and the updates will be applied immediately. They will be available for new campaigns; products in already sent campaigns will not change.


Did this page help you?