PHP MailChimp Campaign CSV Parser

Written by
Typical Read
2 minutes

The MailChimp Campaign CSV Parser is a PHP library to take a downloaded MailChimp Campaign CSV export and parse it in a easy-to-use array. Includes industry rates to compare statistics with.

I’ve worked with MailChimp a lot in past and current projects. My biggest compliant is they’re lack of detailed reports and overly restrictive API usage limits. A common problem I’ve had is extrapolating data from they’re campaign CSV reports — I do this because you can pull more data from the downloaded CSV at one time than the API. A long list of campaign details is useless to marketers if they can’t easy consume, comprehend and make quick decisions off the data. That’s where the MailChimp Campaign CSV Parser PHP library comes in.

Download Now Fork on GitHub


The MailChimp Campaign CSV Parser PHP library is pretty straightforward to use. All you need is a MailChimp Campaign report that can be downloaded from your MailChimp account under ‘Campaigns‘ > ‘Reports‘.

MailChimp Campaign Report
Download MailChimp CSV Report: Log into your MailChimp account, click ‘Campaigns’ then ‘Export’.

Once you’ve downloaded the CSV report, download the MailChimp Campaign CSV Parser PHP library then initialize and configure the library like below:

* Include the MailChimp Report Generator class.
require_once( ‘lib/MailChimp_Campaign_CSV_Parser.class.php’ );

// Initialize the MailChimp Report Generator class.
$MC = new MailChimp_Campaign_CSV_Parser;

// Get data from the MailChimp Report Generator class.
$MC->config[‘mailchimp_campaign_export_file’] = ‘reports/report.csv’;

* Select the industry that relates to the email campaigns
$MC->config[‘industry’] = $industry;

// Get and parse the first 500 campaigns.
$MC->parse_campaign_export( $limit );
$data = $MC->array;[/php]

See the README file for more configuration options. Parsed array includes the following info:


  • Average Abuse Complaint Rate
  • Number of Abuse Complaints
  • Average Bounce Rate
  • Number of Campaigns
  • Number of Clicks
  • Report End Date
  • Number of Forwarded Opens
  • Number of Hard Bounces
  • Highest Campaign Abuse Complaint Rate
  • Highest Campaign Click Rate
  • Highest Campaign Open Rate
  • Industry Statistics
  • Lowest Campaign Abuse Complaint Rate
  • Lowest Campaign Click Rate
  • Lowest Campaign Open Rate
  • Number of Opens
  • Number of Recipients
  • Number of Soft Bounces
  • Report Start Date
  • Number of Successful Deliveries


  • Number of Times Forwarded
  • Number of Total Bounces
  • Number of Trashed/Marked Spam
  • Average Unique Click Rate
  • Number of Unique Clicks
  • Average Unique Open Rate
  • Number of Unique Opens
  • Average Unsubscribe Rate
  • Number of Unsubscribes
  • Highest Campaign Unsubscribe Rate
  • Lowest Campaign Unsubscribe Rate
  • Highest Campaign Trashed/Marked Spam Rate
  • Lowest Campaign Trashed/Marked Spam Rate
  • Number of Days in Report
  • Campaigns by Date
  • Campaigns by Subject
  • Campaigns by Title
  • Campaigns by Weekday
  • Raw Campaign Data


Join the conversation.

Your email address will not be published. Required fields are marked *

All comments posted on 'PHP MailChimp Campaign CSV Parser' are held for moderation and only published when on topic and not rude. Get a gold star if you actually read & follow these rules.

You may write comments in Markdown. This is the best way to post any code, inline like `<div>this</div>` or multiline blocks within triple backtick fences (```) with double new lines before and after.

Want to tell me something privately, like pointing out a typo or stuff like that? Contact Me.