PHP MailChimp Campaign CSV Parser

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.
Published
Updated
Typical Read
2 minutes
Sponsored
Do you run a development agency, freelance developer or offer website services. Contact me today for information about advertising.
Find your next web developer job
jobs by Indeed

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

Usage

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;

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

[columns][columns_left]

  • 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

[/columns_left][columns_right]

  • 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

[/columns_right][/columns]

Did you find PHP MailChimp Campaign CSV Parser useful? Get articles in your inbox.

…and don’t worry, I hate spam as much as you. Expect to hear from me at most once a week.

Latest Job Postings
Posted on Aug 9, 2020 at 9:17pm
Full-time
Los Angeles
Posted on Aug 9, 2020 at 9:15pm
Full-time
Los Angeles
Posted on Aug 9, 2020 at 1:19am
Littleton, CO
jobs by Indeed
Sponsored
Sponsor my site by donating to help support open-source projects, like WordPress Zero Spam, Referrer Analytics & others.
Sponsored
Need help with website, a boost in ranking or online marketing? Contact me today for a free quote.
Sponsored
Need help with website, a boost in ranking or online marketing? Contact me today for a free quote.
Sponsored
Need help with website, a boost in ranking or online marketing? Contact me today for a free quote.
Sponsored
Do you have a great article to share you want to contribute? Contact me about your idea.

Leave a Reply

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.