How to Load Mautic Report Data Into Google Sheets
Mautic's reports are great. Having this data in a spreadsheet is even better. It allows you to analyze it, make custom charts and dashboards and even do some data analysis with your data.
But how do you get report data into a spreadsheet?
I'm excited to share how to pull any report data directly into Google Sheets using Mautic's API and Google's App Scripts.
What's that good for?
You'll get the full capabilities of spreadsheets to analyze your data. Here's an example:
Drip Campaign Drop-Off
I created a new drip campaign. I tested it with a bunch of new subscribers. Now, I wanted to know if there are points, i.e., emails where people click unsubscribe a lot. Spoiler: There is 😔
- At first, I created a report with data source
Emails Sent
- For the data I added the email ID, their internal name, category ID and sent count as data columns.
- I filtered the emails for this specific campaign that triggered people to click unsubscribed.
- I grouped the emails by the ID field and added a calculated column
COUNT Unsubscribed
. - Then, I imported the data into my spreadsheet using the script below.
- Finally, I created a line chart.
Here's the report set-up:
This is the result:
This made it obvious to me that two welcome emails are too much. An almost 10% unsubscribe rate is absurdly high.
Thus, I merged those two emails and shortened it. We'll see how this change will perform in the future.
So, how can you make this, too?
Just copy the spreadsheet I made into your workspace and start importing data. Plug and play! You don't have to code anything!
I developed a Google Apps Script that automates the process of pulling report data from Mautic into Google Sheets. This script is designed to fetch data from specific Mautic reports based on parameters you define, such as report IDs, and date ranges.
This allows you to do some complex data analysis—even if you dislike spreadsheets 😉.
But first things first:
Enable Mautic's API
First, you need to enable Mautic's API. I explained how to do that in this article:
You need to enable HTTP Basic Auth for the script to work. It doesn't support OAuth.