top of page
Writer's pictureNaveen VM

Integrate Google Sheets with Salesforce Marketing Cloud

Updated: Jan 26, 2022

SSJS are hidden gems of marketing cloud. In our last blog, we have seen how to check the automation status via SSJS. In this blog we will see how we can integrate Salesforce Marketing cloud with google sheet.


The idea here is to display Salesforce Marketing Cloud Journey email tracking directly in Google Sheets in real time!


Create a Cloud Page with code resource as JavaScript and add the below SSJS code (view code snippet):



There are 2 parameters in URL:

  • tskey - Triggered send external key. For all the journey emails we create, SFMC internally creates a triggered email. Give the external key for journey triggered email.

  • metric - keep the value as 'all'


This will return a JSON in the web page.


Now we will import the JSON into Google sheets


  • Create a google sheet.

  • Go to Extensions--> Script editor

  • Delete the placeholder content and paste the code from this script.

  • Rename the script to ImportJSON.gs and click the save button

  • Back in the spreadsheet, in a cell, you can type as "=ImportJSON("http://example.com/test?tskey=1234&metric=all", "", "Headers")"

  • Or if you don't need header, you can type as "=ImportJSON("http://example.com/test?tskey=1234&metric=all","","noInherit,noTruncate,noHeaders")"

Below is the screenshot of how the google sheet looks like:


Please feel free to leave your feedback/ comment in case of any queries.


Happy learning!


2,192 views7 comments

댓글 7개


Luis Panta
Luis Panta
2023년 5월 05일

Es genial, sabes si puedo enviar datos de una ED de Salesforce Marketing Cloud a Google Sheets?.. tengo unas ED que se alimentan de inscripciones que hacen mediante una landing, y necesito pasarlo de forma automatizada a un GSheets a otro equipo.

좋아요

Vinoth Kumar
Vinoth Kumar
2022년 5월 17일

Hello,

This is super cool!

With the current implementation, I see that I can pull only the Client Id, External key of the Journey, Name of the journey, and send stats.

Is it possible that we can also store the subscriber's information in the google sheet who has clicked the CTA button?


좋아요
Naveen VM
Naveen VM
2022년 5월 17일
답글 상대:

Thanks for your feedback Vinoth!

With this way you can only able to track at aggregated level but not at the individual / subscriber level.

좋아요

Là De Masi
Là De Masi
2021년 9월 23일

does anyone know if this is possible not only with triggered sends but with normal email send flow? I need to import monthly report in G Sheet via API.

좋아요
Naveen VM
Naveen VM
2021년 9월 23일
답글 상대:

Hi , Currently its only possible with Triggered sends.

좋아요

Daniel Gonzalez
Daniel Gonzalez
2021년 3월 15일

What about the other way round, from GSheet to Data Extension.

좋아요
Naveen VM
Naveen VM
2022년 5월 17일
답글 상대:

Hi Daniel, you can try using App script in Google sheet by passing parameters in Cloud pages URL and in the cloud page you can write the logic using Ampscript or SSJS where you can able to insert a record into data extension.

좋아요
bottom of page