ActiveCampaign Forum

Sending ActiveCampaign Webhook to Google Sheets


#1

Hey there, I’m a bit of a newbie when it comes to working with APIs, but I know it’s possible to send a webhook from ActiveCampaign –> Google App Script whenever my contacts take certain actions, and I’m wondering how to add a +1 count to a cell every time the webhook triggers?

Here’s a basic Google Sheet that I’m looking to update: https://docs.google.com/spreadsheets/d/1UfRFM7Uz0YUqemPTVYe1lmZ5NC5v9naFvmlLvXPZuVM/edit#gid=0

I’ve figured out how to send out webhooks to the Google Web App like this for every action:

https://script.google.com/a/modernmusician.me/macros/s/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/exec?tag=TourHackingLead&count=1

https://script.google.com/a/modernmusician.me/macros/s/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/exec?tag=DDSCompleted&count=1

https://script.google.com/a/modernmusician.me/macros/s/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/exec?tag=Applications&count=1

^^ these will each contain a payload with the contact info from ActiveCampaign (although I’m not sure that’s it’s necessary).

I just need to know how to tell Google Sheets to add +1 to the correct column (action) & row (date) based on the webhook.

Any ideas?

Thanks so much,

Michael


#2

Hi Michael, I think you’re better off asking this question in the Google Apps Script community. However the simplest workaround I can imagine is to capture the raw events in rows in a separate sheet and then just use the countif function in Sheets to count each type of action.


#3

Hey Michael, I agree w/ @newcraftgroup here.

I would create two separate sheets within your Google Spreadsheet, maybe label one of them ‘RAW-DATA’ and the other one ‘Summary’. I would direct all your webhooks to populate the raw data sheet, and then use Google’s built in functions to summarize that data however you’d like.


#4

thank you!!

What’s the simplest way to capture the raw events in the ‘RAW-DATA’ Google Sheet?

Michael


#6

For anyone who’s interested, I managed to get this set up on my own - it was crazy difficult for me, but it’s working great now.

Basically, I set up a webhook for every action I wanted to track and changed the end of the Google App Script URL to “?metric=______” (based on the name of the column in Sheets).

So now it’s SUPER easy to keep track of my funnel metrics every day of the month, and it updates automatically.

Here’s the App Script code: https://docs.google.com/document/d/1UUfmRLKOKQcyRIjsOinhBEVbFd0uGqNDzA1Um05asmo/edit?usp=sharing