Class: Mailchimp::Reports

Inherits:
Object
  • Object
show all
Defined in:
lib/mailchimp/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(master) ⇒ Reports

Returns a new instance of Reports.



1784
1785
1786
# File 'lib/mailchimp/api.rb', line 1784

def initialize(master)
    @master = master
end

Instance Attribute Details

#masterObject

Returns the value of attribute master.



1782
1783
1784
# File 'lib/mailchimp/api.rb', line 1782

def master
  @master
end

Instance Method Details

#abuse(cid, opts = []) ⇒ Hash

Get all email addresses that complained about a given campaign

Parameters:

  • cid (String)

    the campaign id to pull abuse reports for (can be gathered using campaigns/list())

  • opts (Hash) (defaults to: [])

    various options for controlling returned data

    • Int

      start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)

    • Int

      limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100

    • String

      since optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg “2013-12-30 20:30:00”

Returns:

  • (Hash)

    abuse report data for this campaign

    • Int

      total the total reports matched

    • Array

      data a struct for the each report, including:

      - [String] date date/time the abuse report was received and processed
      - [String] member the email address that reported abuse - will only contain email if the list or member has been removed
      - [String] type an internal type generally specifying the originating mail provider - may not be useful outside of filling report views
      


1800
1801
1802
1803
# File 'lib/mailchimp/api.rb', line 1800

def abuse(cid, opts=[])
    _params = {:cid => cid, :opts => opts}
    return @master.call 'reports/abuse', _params
end

#advice(cid) ⇒ Array

Retrieve the text presented in our app for how a campaign performed and any advice we may have for you - best suited for display in customized reports pages. Note: some messages will contain HTML - clean tags as necessary

Parameters:

  • cid (String)

    the campaign id to pull advice text for (can be gathered using campaigns/list())

Returns:

  • (Array)

    of structs for advice on the campaign’s performance, each containing:

    • String

      msg the advice message

    • String

      type the “type” of the message. one of: negative, positive, or neutral



1810
1811
1812
1813
# File 'lib/mailchimp/api.rb', line 1810

def advice(cid)
    _params = {:cid => cid}
    return @master.call 'reports/advice', _params
end

#bounce_message(cid, email) ⇒ Hash

Retrieve the most recent full bounce message for a specific email address on the given campaign. Messages over 30 days old are subject to being removed

Parameters:

  • cid (String)

    the campaign id to pull bounces for (can be gathered using campaigns/list())

  • email (Hash)

    a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Providing multiples and will use the first we see in this same order.

    • String

      email an email address - this is recommended for this method

    • String

      euid the unique id for an email address (not list related) - the email “id” returned from listMemberInfo, Webhooks, Campaigns, etc.

    • String

      leid the list email id (previously called web_id) for a list-member-info type call. this doesn’t change when the email address changes

Returns:

  • (Hash)

    the full bounce message for this email+campaign along with some extra data.

    • String

      date date the bounce was received and processed

    • Hash

      member the member record as returned by lists/member-info()

    • String

      message the entire bounce message received



1825
1826
1827
1828
# File 'lib/mailchimp/api.rb', line 1825

def bounce_message(cid, email)
    _params = {:cid => cid, :email => email}
    return @master.call 'reports/bounce-message', _params
end

#bounce_messages(cid, opts = []) ⇒ Hash

Retrieve the full bounce messages for the given campaign. Note that this can return very large amounts of data depending on how large the campaign was and how much cruft the bounce provider returned. Also, messages over 30 days old are subject to being removed

Parameters:

  • cid (String)

    the campaign id to pull bounces for (can be gathered using campaigns/list())

  • opts (Hash) (defaults to: [])

    various options for controlling returned data

    • Int

      start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)

    • Int

      limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100

    • String

      since optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg “2013-12-30 20:30:00”

Returns:

  • (Hash)

    data for the full bounce messages for this campaign

    • Int

      total that total number of bounce messages for the campaign

    • Array

      data structs containing the data for this page

      - [String] date date the bounce was received and processed
      - [Hash] member the member record as returned by lists/member-info()
      - [String] message the entire bounce message received
      


1842
1843
1844
1845
# File 'lib/mailchimp/api.rb', line 1842

def bounce_messages(cid, opts=[])
    _params = {:cid => cid, :opts => opts}
    return @master.call 'reports/bounce-messages', _params
end

#click_detail(cid, tid, opts = []) ⇒ Hash

Return the list of email addresses that clicked on a given url, and how many times they clicked

Parameters:

  • cid (String)

    the campaign id to get click stats for (can be gathered using campaigns/list())

  • tid (Int)

    the “tid” for the URL from reports/clicks

  • opts (Hash) (defaults to: [])

    various options for controlling returned data

    • Int

      start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)

    • Int

      limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100

    • String

      sort_field optional the data to sort by - “clicked” (order clicks occurred, default) or “clicks” (total number of opens). Invalid fields will fall back on the default.

    • String

      sort_dir optional the direct - ASC or DESC. defaults to ASC (case insensitive)

Returns:

  • (Hash)

    containing the total records matched and the specific records for this page

    • Int

      total the total number of records matched

    • Array

      data structs for each email addresses that click the requested url

      - [Hash] member the member record as returned by lists/member-info()
      - [Int] clicks Total number of times the URL was clicked by this email address
      


1860
1861
1862
1863
# File 'lib/mailchimp/api.rb', line 1860

def click_detail(cid, tid, opts=[])
    _params = {:cid => cid, :tid => tid, :opts => opts}
    return @master.call 'reports/click-detail', _params
end

#clicks(cid) ⇒ Hash

The urls tracked and their click counts for a given campaign.

Parameters:

  • cid (String)

    the campaign id to pull stats for (can be gathered using campaigns/list())

Returns:

  • (Hash)

    including:

    • Array

      total structs for each url tracked for the full campaign

      - [String] url the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
      - [Int] clicks Number of times the specific link was clicked
      - [Double] clicks_percent the percentage of total clicks "clicks" represents
      - [Int] unique Number of unique people who clicked on the specific link
      - [Double] unique_percent the percentage of unique clicks "unique" represents
      - [Int] tid the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
      
    • Array

      a if this was an absplit campaign, stat structs for the a group

      - [String] url the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
      - [Int] clicks Number of times the specific link was clicked
      - [Double] clicks_percent the percentage of total clicks "clicks" represents
      - [Int] unique Number of unique people who clicked on the specific link
      - [Double] unique_percent the percentage of unique clicks "unique" represents
      - [Int] tid the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
      
    • Array

      b if this was an absplit campaign, stat structs for the b group

      - [String] url the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
      - [Int] clicks Number of times the specific link was clicked
      - [Double] clicks_percent the percentage of total clicks "clicks" represents
      - [Int] unique Number of unique people who clicked on the specific link
      - [Double] unique_percent the percentage of unique clicks "unique" represents
      - [Int] tid the tracking id used in campaign links - used primarily for reports/click-activity. also can be used to order urls by the order they appeared in the campaign to recreate our heat map.
      


1889
1890
1891
1892
# File 'lib/mailchimp/api.rb', line 1889

def clicks(cid)
    _params = {:cid => cid}
    return @master.call 'reports/clicks', _params
end

#domain_performance(cid) ⇒ Array

Get the top 5 performing email domains for this campaign. Users wanting more than 5 should use campaign reports/member-activity() or campaignEmailStatsAIMAll() and generate any additional stats they require.

Parameters:

  • cid (String)

    the campaign id to pull email domain performance for (can be gathered using campaigns/list())

Returns:

  • (Array)

    domains structs for each email domains and their associated stats

    • String

      domain Domain name or special “Other” to roll-up stats past 5 domains

    • Int

      total_sent Total Email across all domains - this will be the same in every row

    • Int

      emails Number of emails sent to this domain

    • Int

      bounces Number of bounces

    • Int

      opens Number of opens

    • Int

      clicks Number of clicks

    • Int

      unsubs Number of unsubs

    • Int

      delivered Number of deliveries

    • Int

      emails_pct Percentage of emails that went to this domain (whole number)

    • Int

      bounces_pct Percentage of bounces from this domain (whole number)

    • Int

      opens_pct Percentage of opens from this domain (whole number)

    • Int

      clicks_pct Percentage of clicks from this domain (whole number)

    • Int

      unsubs_pct Percentage of unsubs from this domain (whole number)



2035
2036
2037
2038
# File 'lib/mailchimp/api.rb', line 2035

def domain_performance(cid)
    _params = {:cid => cid}
    return @master.call 'reports/domain-performance', _params
end

#ecomm_orders(cid, opts = []) ⇒ Hash

Retrieve the Ecommerce Orders tracked by ecomm/order-add()

Parameters:

  • cid (String)

    the campaign id to pull orders for for (can be gathered using campaigns/list())

  • opts (Hash) (defaults to: [])

    various options for controlling returned data

    • Int

      start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)

    • Int

      limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100

    • String

      since optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg “2013-12-30 20:30:00”

Returns:

  • (Hash)

    the total matching orders and the specific orders for the requested page

    • Int

      total the total matching orders

    • Array

      data structs for the actual data for each order being returned

    • String

      store_id the store id generated by the plugin used to uniquely identify a store

    • String

      store_name the store name collected by the plugin - often the domain name

    • String

      order_id the internal order id the store tracked this order by

    • Hash

      member the member record as returned by lists/member-info() that received this campaign and is associated with this order

    • Double

      order_total the order total

    • Double

      tax_total the total tax for the order (if collected)

    • Double

      ship_total the shipping total for the order (if collected)

    • String

      order_date the date the order was tracked - from the store if possible, otherwise the GMT time we received it

    • Array

      lines structs containing details of the order:

      - [Int] line_num the line number assigned to this line
      - [Int] product_id the product id assigned to this item
      - [String] product_name the product name
      - [String] product_sku the sku for the product
      - [Int] product_category_id the id for the product category
      - [String] product_category_name the product category name
      - [Double] qty optional the quantity of the item ordered - defaults to 1
      - [Double] cost optional the cost of a single item (ie, not the extended cost of the line) - defaults to 0
      


1920
1921
1922
1923
# File 'lib/mailchimp/api.rb', line 1920

def ecomm_orders(cid, opts=[])
    _params = {:cid => cid, :opts => opts}
    return @master.call 'reports/ecomm-orders', _params
end

#eepurl(cid) ⇒ Hash

Retrieve the eepurl stats from the web/Twitter mentions for this campaign

Parameters:

  • cid (String)

    the campaign id to pull stats for (can be gathered using campaigns/list())

Returns:

  • (Hash)

    containing tweets, retweets, clicks, and referrer related to using the campaign’s eepurl

    • Hash

      twitter various Twitter related stats

      - [Int] tweets Total number of tweets seen
      - [String] first_tweet date and time of the first tweet seen
      - [String] last_tweet date and time of the last tweet seen
      - [Int] retweets Total number of retweets seen
      - [String] first_retweet date and time of the first retweet seen
      - [String] last_retweet date and time of the last retweet seen
      - [Array] statuses an structs for statuses recorded including:
          - [String] status the text of the tweet/update
          - [String] screen_name the screen name as recorded when first seen
          - [String] status_id the status id of the tweet (they are really unsigned 64 bit ints)
          - [String] datetime the date/time of the tweet
          - [Bool] is_retweet whether or not this was a retweet
      
    • Hash

      clicks stats related to click-throughs on the eepurl

      - [Int] clicks Total number of clicks seen
      - [String] first_click date and time of the first click seen
      - [String] last_click date and time of the first click seen
      - [Array] locations structs for geographic locations including:
          - [String] country the country name the click was tracked to
          - [String] region the region in the country the click was tracked to (if available)
      
    • Array

      referrers structs for referrers, including

      - [String] referrer the referrer, truncated to 100 bytes
      - [Int] clicks Total number of clicks seen from this referrer
      - [String] first_click date and time of the first click seen from this referrer
      - [String] last_click date and time of the first click seen from this referrer
      


1953
1954
1955
1956
# File 'lib/mailchimp/api.rb', line 1953

def eepurl(cid)
    _params = {:cid => cid}
    return @master.call 'reports/eepurl', _params
end

#geo_opens(cid) ⇒ Array

Retrieve the countries/regions and number of opens tracked for each. Email address are not returned.

Parameters:

  • cid (String)

    the campaign id to pull bounces for (can be gathered using campaigns/list())

Returns:

  • (Array)

    an array of country structs where opens occurred

    • String

      code The ISO3166 2 digit country code

    • String

      name A version of the country name, if we have it

    • Int

      opens The total number of opens that occurred in the country

    • Array

      regions structs of data for each sub-region in the country

      - [String] code An internal code for the region. When this is blank, it indicates we know the country, but not the region
      - [String] name The name of the region, if we have one. For blank "code" values, this will be "Rest of Country"
      - [Int] opens The total number of opens that occurred in the country
      


2050
2051
2052
2053
# File 'lib/mailchimp/api.rb', line 2050

def geo_opens(cid)
    _params = {:cid => cid}
    return @master.call 'reports/geo-opens', _params
end

#google_analytics(cid) ⇒ Array

Retrieve the Google Analytics data we’ve collected for this campaign. Note, requires Google Analytics Add-on to be installed and configured.

Parameters:

  • cid (String)

    the campaign id to pull bounces for (can be gathered using campaigns/list())

Returns:

  • (Array)

    of structs for analytics we’ve collected for the passed campaign.

    • Int

      visits number of visits

    • Int

      pages number of page views

    • Int

      new_visits new visits recorded

    • Int

      bounces vistors who “bounced” from your site

    • Double

      time_on_site the total time visitors spent on your sites

    • Int

      goal_conversions number of goals converted

    • Double

      goal_value value of conversion in dollars

    • Double

      revenue revenue generated by campaign

    • Int

      transactions number of transactions tracked

    • Int

      ecomm_conversions number Ecommerce transactions tracked

    • Array

      goals structs containing goal names and number of conversions

      - [String] name the name of the goal
      - [Int] conversions the number of conversions for the goal
      


2071
2072
2073
2074
# File 'lib/mailchimp/api.rb', line 2071

def google_analytics(cid)
    _params = {:cid => cid}
    return @master.call 'reports/google-analytics', _params
end

#member_activity(cid, emails) ⇒ Hash

Given a campaign and email address, return the entire click and open history with timestamps, ordered by time. If you need to dump the full activity for a campaign and/or get incremental results, you should use the <a href=“apidocs.mailchimp.com/export/1.0/campaignsubscriberactivity.func.php” targret=“_new”>campaignSubscriberActivity Export API method</a>, <strong>not</strong> this, especially for large campaigns.

Parameters:

  • cid (String)

    the campaign id to get stats for (can be gathered using campaigns/list())

  • emails (Array)

    an array of up to 50 email address struct to retrieve activity information for

    • String

      email an email address

    • String

      euid the unique id for an email address (not list related) - the email “id” returned from listMemberInfo, Webhooks, Campaigns, etc.

    • String

      leid the list email id (previously called web_id) for a list-member-info type call. this doesn’t change when the email address changes

Returns:

  • (Hash)

    of data and success/error counts

    • Int

      success_count the number of subscribers successfully found on the list

    • Int

      error_count the number of subscribers who were not found on the list

    • Array

      errors array of error structs including:

      - [String] email whatever was passed in the email parameter
          - [String] email the email address added
          - [String] euid the email unique id
          - [String] leid the list member's truly unique id
      - [String] msg the error message
      
    • Array

      data an array of structs where each activity record has:

      - [String] email whatever was passed in the email parameter
          - [String] email the email address added
          - [String] euid the email unique id
          - [String] leid the list member's truly unique id
      - [Hash] member the member record as returned by lists/member-info()
      - [Array] activity an array of structs containing the activity, including:
          - [String] action The action name - either open or click
          - [String] timestamp The date/time of the action (GMT)
          - [String] url For click actions, the url clicked, otherwise this is empty
          - [String] ip The IP address the activity came from
      


1984
1985
1986
1987
# File 'lib/mailchimp/api.rb', line 1984

def member_activity(cid, emails)
    _params = {:cid => cid, :emails => emails}
    return @master.call 'reports/member-activity', _params
end

#not_opened(cid, opts = []) ⇒ Hash

Retrieve the list of email addresses that did not open a given campaign

Parameters:

  • cid (String)

    the campaign id to get no opens for (can be gathered using campaigns/list())

  • opts (Hash) (defaults to: [])

    various options for controlling returned data

    • Int

      start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)

    • Int

      limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100

Returns:

  • (Hash)

    a total of all matching emails and the specific emails for this page

    • Int

      total the total number of members who didn’t open the campaign

    • Array

      data structs for each campaign member matching as returned by lists/member-info()



1997
1998
1999
2000
# File 'lib/mailchimp/api.rb', line 1997

def not_opened(cid, opts=[])
    _params = {:cid => cid, :opts => opts}
    return @master.call 'reports/not-opened', _params
end

#opened(cid, opts = []) ⇒ Hash

Retrieve the list of email addresses that opened a given campaign with how many times they opened

Parameters:

  • cid (String)

    the campaign id to get opens for (can be gathered using campaigns/list())

  • opts (Hash) (defaults to: [])

    various options for controlling returned data

    • Int

      start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)

    • Int

      limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100

    • String

      sort_field optional the data to sort by - “opened” (order opens occurred, default) or “opens” (total number of opens). Invalid fields will fall back on the default.

    • String

      sort_dir optional the direct - ASC or DESC. defaults to ASC (case insensitive)

Returns:

  • (Hash)

    containing the total records matched and the specific records for this page

    • Int

      total the total number of records matched

    • Array

      data structs for the actual opens data, including:

      - [Hash] member the member record as returned by lists/member-info()
      - [Int] opens Total number of times the campaign was opened by this email address
      


2014
2015
2016
2017
# File 'lib/mailchimp/api.rb', line 2014

def opened(cid, opts=[])
    _params = {:cid => cid, :opts => opts}
    return @master.call 'reports/opened', _params
end

#sent_to(cid, opts = []) ⇒ Hash

Get email addresses the campaign was sent to

Parameters:

  • cid (String)

    the campaign id to pull members for (can be gathered using campaigns/list())

  • opts (Hash) (defaults to: [])

    various options for controlling returned data

    • String

      status optional the status to pull - one of ‘sent’, ‘hard’ (bounce), or ‘soft’ (bounce). By default, all records are returned

    • Int

      start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)

    • Int

      limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100

Returns:

  • (Hash)

    a total of all matching emails and the specific emails for this page

    • Int

      total the total number of members for the campaign and status

    • Array

      data structs for each campaign member matching

      - [Hash] member the member record as returned by lists/member-info()
      - [String] status the status of the send - one of 'sent', 'hard', 'soft'
      - [String] absplit_group if this was an absplit campaign, one of 'a','b', or 'winner'
      - [String] tz_group if this was an timewarp campaign the timezone GMT offset the member was included in
      


2089
2090
2091
2092
# File 'lib/mailchimp/api.rb', line 2089

def sent_to(cid, opts=[])
    _params = {:cid => cid, :opts => opts}
    return @master.call 'reports/sent-to', _params
end

#share(cid, opts = []) ⇒ Hash

Get the URL to a customized <a href=“eepurl.com/gKmL” target=“_blank”>VIP Report</a> for the specified campaign and optionally send an email to someone with links to it. Note subsequent calls will overwrite anything already set for the same campign (eg, the password)

Parameters:

  • cid (String)

    the campaign id to share a report for (can be gathered using campaigns/list())

  • opts (Array) (defaults to: [])

    optional various parameters which can be used to configure the shared report

    • String

      to_email optional - optional, comma delimited list of email addresses to share the report with - no value means an email will not be sent

    • Int

      theme_id optional - either a global or a user-specific theme id. Currently this needs to be pulled out of either the Share Report or Cobranding web views by grabbing the “theme” attribute from the list presented.

    • String

      css_url optional - a link to an external CSS file to be included after our default CSS (vip-reports.net/css/vip.css) <strong>only if</strong> loaded via the “secure_url” - max 255 bytes

Returns:

  • (Hash)

    details for the shared report, including:

    • String

      title The Title of the Campaign being shared

    • String

      url The URL to the shared report

    • String

      secure_url The URL to the shared report, including the password (good for loading in an IFRAME). For non-secure reports, this will not be returned

    • String

      password If secured, the password for the report, otherwise this field will not be returned



2105
2106
2107
2108
# File 'lib/mailchimp/api.rb', line 2105

def share(cid, opts=[])
    _params = {:cid => cid, :opts => opts}
    return @master.call 'reports/share', _params
end

#summary(cid) ⇒ Hash

Retrieve relevant aggregate campaign statistics (opens, bounces, clicks, etc.)

Parameters:

  • cid (String)

    the campaign id to pull stats for (can be gathered using campaigns/list())

Returns:

  • (Hash)

    the statistics for this campaign

    • Int

      syntax_errors Number of email addresses in campaign that had syntactical errors.

    • Int

      hard_bounces Number of email addresses in campaign that hard bounced.

    • Int

      soft_bounces Number of email addresses in campaign that soft bounced.

    • Int

      unsubscribes Number of email addresses in campaign that unsubscribed.

    • Int

      abuse_reports Number of email addresses in campaign that reported campaign for abuse.

    • Int

      forwards Number of times email was forwarded to a friend.

    • Int

      forwards_opens Number of times a forwarded email was opened.

    • Int

      opens Number of times the campaign was opened.

    • String

      last_open Date of the last time the email was opened.

    • Int

      unique_opens Number of people who opened the campaign.

    • Int

      clicks Number of times a link in the campaign was clicked.

    • Int

      unique_clicks Number of unique recipient/click pairs for the campaign.

    • String

      last_click Date of the last time a link in the email was clicked.

    • Int

      users_who_clicked Number of unique recipients who clicked on a link in the campaign.

    • Int

      emails_sent Number of email addresses campaign was sent to.

    • Int

      unique_likes total number of unique likes (Facebook)

    • Int

      recipient_likes total number of recipients who liked (Facebook) the campaign

    • Int

      facebook_likes total number of likes (Facebook) that came from Facebook

    • Hash

      industry Various rates/percentages for the account’s selected industry - empty otherwise. These will vary across calls, do not use them for anything important.

      - [String] type the selected industry
      - [Float] open_rate industry open rate
      - [Float] click_rate industry click rate
      - [Float] bounce_rate industry bounce rate
      - [Float] unopen_rate industry unopen rate
      - [Float] unsub_rate industry unsub rate
      - [Float] abuse_rate industry abuse rate
      
    • Hash

      absplit If this was an absplit campaign, stats for the A and B groups will be returned - otherwise this is empty

      - [Int] bounces_a bounces for the A group
      - [Int] bounces_b bounces for the B group
      - [Int] forwards_a forwards for the A group
      - [Int] forwards_b forwards for the B group
      - [Int] abuse_reports_a abuse reports for the A group
      - [Int] abuse_reports_b abuse reports for the B group
      - [Int] unsubs_a unsubs for the A group
      - [Int] unsubs_b unsubs for the B group
      - [Int] recipients_click_a clicks for the A group
      - [Int] recipients_click_b clicks for the B group
      - [Int] forwards_opens_a opened forwards for the A group
      - [Int] forwards_opens_b opened forwards for the B group
      - [Int] opens_a total opens for the A group
      - [Int] opens_b total opens for the B group
      - [String] last_open_a date/time of last open for the A group
      - [String] last_open_b date/time of last open for the BG group
      - [Int] unique_opens_a unique opens for the A group
      - [Int] unique_opens_b unique opens for the B group
      
    • Array

      timewarp If this campaign was a Timewarp campaign, an array of structs from each timezone stats exist for. Each will contain:

      - [Int] opens opens for this timezone
      - [String] last_open the date/time of the last open for this timezone
      - [Int] unique_opens the unique opens for this timezone
      - [Int] clicks the total clicks for this timezone
      - [String] last_click the date/time of the last click for this timezone
      - [Int] unique_opens the unique clicks for this timezone
      - [Int] bounces the total bounces for this timezone
      - [Int] total the total number of members sent to in this timezone
      - [Int] sent the total number of members delivered to in this timezone
      
    • Array

      timeseries structs for the first 24 hours of the campaign, per-hour stats:

      - [String] timestamp The timestemp in Y-m-d H:00:00 format
      - [Int] emails_sent the total emails sent during the hour
      - [Int] unique_opens unique opens seen during the hour
      - [Int] recipients_click unique clicks seen during the hour
      


2173
2174
2175
2176
# File 'lib/mailchimp/api.rb', line 2173

def summary(cid)
    _params = {:cid => cid}
    return @master.call 'reports/summary', _params
end

#unsubscribes(cid, opts = []) ⇒ Hash

Get all unsubscribed email addresses for a given campaign

Parameters:

  • cid (String)

    the campaign id to pull bounces for (can be gathered using campaigns/list())

  • opts (Hash) (defaults to: [])

    various options for controlling returned data

    • Int

      start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)

    • Int

      limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100

Returns:

  • (Hash)

    a total of all unsubscribed emails and the specific members for this page

    • Int

      total the total number of unsubscribes for the campaign

    • Array

      data structs for the email addresses that unsubscribed

      - [String] member the member that unsubscribed as returned by lists/member-info()
      - [String] reason the reason collected for the unsubscribe. If populated, one of 'NORMAL','NOSIGNUP','INAPPROPRIATE','SPAM','OTHER'
      - [String] reason_text if the reason is OTHER, the text entered.
      


2189
2190
2191
2192
# File 'lib/mailchimp/api.rb', line 2189

def unsubscribes(cid, opts=[])
    _params = {:cid => cid, :opts => opts}
    return @master.call 'reports/unsubscribes', _params
end