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.
1863 1864 1865 |
# File 'lib/mailchimp/api.rb', line 1863 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
1861 1862 1863 |
# File 'lib/mailchimp/api.rb', line 1861 def master @master end |
Instance Method Details
#abuse(cid, opts = []) ⇒ Hash
Get all email addresses that complained about a given campaign
1879 1880 1881 1882 |
# File 'lib/mailchimp/api.rb', line 1879 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
1889 1890 1891 1892 |
# File 'lib/mailchimp/api.rb', line 1889 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
1904 1905 1906 1907 |
# File 'lib/mailchimp/api.rb', line 1904 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
1921 1922 1923 1924 |
# File 'lib/mailchimp/api.rb', line 1921 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
1939 1940 1941 1942 |
# File 'lib/mailchimp/api.rb', line 1939 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.
1968 1969 1970 1971 |
# File 'lib/mailchimp/api.rb', line 1968 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.
2114 2115 2116 2117 |
# File 'lib/mailchimp/api.rb', line 2114 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()
1999 2000 2001 2002 |
# File 'lib/mailchimp/api.rb', line 1999 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
2032 2033 2034 2035 |
# File 'lib/mailchimp/api.rb', line 2032 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.
2129 2130 2131 2132 |
# File 'lib/mailchimp/api.rb', line 2129 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.
2150 2151 2152 2153 |
# File 'lib/mailchimp/api.rb', line 2150 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.
2063 2064 2065 2066 |
# File 'lib/mailchimp/api.rb', line 2063 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
2076 2077 2078 2079 |
# File 'lib/mailchimp/api.rb', line 2076 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
2093 2094 2095 2096 |
# File 'lib/mailchimp/api.rb', line 2093 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
2168 2169 2170 2171 |
# File 'lib/mailchimp/api.rb', line 2168 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)
2184 2185 2186 2187 |
# File 'lib/mailchimp/api.rb', line 2184 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.)
2252 2253 2254 2255 |
# File 'lib/mailchimp/api.rb', line 2252 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
2268 2269 2270 2271 |
# File 'lib/mailchimp/api.rb', line 2268 def unsubscribes(cid, opts=[]) _params = {:cid => cid, :opts => opts} return @master.call 'reports/unsubscribes', _params end |