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.
1784 1785 1786 |
# File 'lib/mailchimp/api.rb', line 1784 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
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
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
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
1825 1826 1827 1828 |
# File 'lib/mailchimp/api.rb', line 1825 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
1842 1843 1844 1845 |
# File 'lib/mailchimp/api.rb', line 1842 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
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.
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.
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()
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
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.
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.
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.
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
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
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
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)
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.)
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
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 |