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 😔

  1. At first, I created a report with data source Emails Sent
  2. For the data I added the email ID, their internal name, category ID and sent count as data columns.
  3. I filtered the emails for this specific campaign that triggered people to click unsubscribed.
  4. I grouped the emails by the ID field and added a calculated column COUNT Unsubscribed.
  5. Then, I imported the data into my spreadsheet using the script below.
  6. 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:

How to Use the Mautic API
Are you looking to automate repetitive tasks or integrate Mautic with other platforms? Do you need to create, modify or delete a lot of data and want to use a script you wrote? The Mautic API offers a robust solution to fulfill your needs. 💡In this article: Learn how to

You need to enable HTTP Basic Auth for the script to work. It doesn't support OAuth.

Copy the Spreadsheet and Script

The remainder of this article and the script is for premium subscribers only. Please subscribe to get access.