Class: Mailchimp::Reports
- Inherits:
-
Object
- Object
- Mailchimp::Reports
- Defined in:
- lib/mailchimp/api.rb
Instance Attribute Summary collapse
-
#master ⇒ Object
Returns the value of attribute master.
Instance Method Summary collapse
-
#abuse(cid, opts = []) ⇒ Hash
Get all email addresses that complained about a given campaign.
-
#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.
-
#bounce_message(cid, email) ⇒ Hash
Retrieve the most recent full bounce message for a specific email address on the given campaign.
-
#bounce_messages(cid, opts = []) ⇒ Hash
Retrieve the full bounce messages for the given campaign.
-
#click_detail(cid, tid, opts = []) ⇒ Hash
Return the list of email addresses that clicked on a given url, and how many times they clicked.
-
#clicks(cid) ⇒ Hash
The urls tracked and their click counts for a given campaign.
-
#domain_performance(cid) ⇒ Array
Get the top 5 performing email domains for this campaign.
-
#ecomm_orders(cid, opts = []) ⇒ Hash
Retrieve the Ecommerce Orders tracked by ecomm/order-add().
-
#eepurl(cid) ⇒ Hash
Retrieve the eepurl stats from the web/Twitter mentions for this campaign.
-
#geo_opens(cid) ⇒ Array
Retrieve the countries/regions and number of opens tracked for each.
-
#google_analytics(cid) ⇒ Array
Retrieve the Google Analytics data we’ve collected for this campaign.
-
#initialize(master) ⇒ Reports
constructor
A new instance of Reports.
-
#member_activity(cid, emails) ⇒ Hash
Given a campaign and email address, return the entire click and open history with timestamps, ordered by time.
-
#not_opened(cid, opts = []) ⇒ Hash
Retrieve the list of email addresses that did not open a given campaign.
-
#opened(cid, opts = []) ⇒ Hash
Retrieve the list of email addresses that opened a given campaign with how many times they opened.
-
#sent_to(cid, opts = []) ⇒ Hash
Get email addresses the campaign was sent to.
-
#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.
-
#summary(cid) ⇒ Hash
Retrieve relevant aggregate campaign statistics (opens, bounces, clicks, etc.).
-
#unsubscribes(cid, opts = []) ⇒ Hash
Get all unsubscribed email addresses for a given campaign.
Constructor Details
#initialize(master) ⇒ Reports
Returns a new instance of Reports.
1869 1870 1871 |
# File 'lib/mailchimp/api.rb', line 1869 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
1867 1868 1869 |
# File 'lib/mailchimp/api.rb', line 1867 def master @master end |
Instance Method Details
#abuse(cid, opts = []) ⇒ Hash
Get all email addresses that complained about a given campaign
1885 1886 1887 1888 |
# File 'lib/mailchimp/api.rb', line 1885 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
1895 1896 1897 1898 |
# File 'lib/mailchimp/api.rb', line 1895 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
1910 1911 1912 1913 |
# File 'lib/mailchimp/api.rb', line 1910 def (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
1927 1928 1929 1930 |
# File 'lib/mailchimp/api.rb', line 1927 def (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
1945 1946 1947 1948 |
# File 'lib/mailchimp/api.rb', line 1945 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.
1974 1975 1976 1977 |
# File 'lib/mailchimp/api.rb', line 1974 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.
2120 2121 2122 2123 |
# File 'lib/mailchimp/api.rb', line 2120 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()
2005 2006 2007 2008 |
# File 'lib/mailchimp/api.rb', line 2005 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
2038 2039 2040 2041 |
# File 'lib/mailchimp/api.rb', line 2038 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.
2135 2136 2137 2138 |
# File 'lib/mailchimp/api.rb', line 2135 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.
2156 2157 2158 2159 |
# File 'lib/mailchimp/api.rb', line 2156 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.
2069 2070 2071 2072 |
# File 'lib/mailchimp/api.rb', line 2069 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
2082 2083 2084 2085 |
# File 'lib/mailchimp/api.rb', line 2082 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
2099 2100 2101 2102 |
# File 'lib/mailchimp/api.rb', line 2099 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
2174 2175 2176 2177 |
# File 'lib/mailchimp/api.rb', line 2174 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)
2190 2191 2192 2193 |
# File 'lib/mailchimp/api.rb', line 2190 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.)
2258 2259 2260 2261 |
# File 'lib/mailchimp/api.rb', line 2258 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
2274 2275 2276 2277 |
# File 'lib/mailchimp/api.rb', line 2274 def unsubscribes(cid, opts=[]) _params = {:cid => cid, :opts => opts} return @master.call 'reports/unsubscribes', _params end |