Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: develop
@mbernier mbernier
77 lines (69 sloc) 3.684 kb
layout weight title navigation
page
0
Advanced Statistics
show
true

{% warning %} This endpoint is being deprecated by the addition of the v3 Advanced Statistics API. {% endwarning %}

Advanced Statistics methods provide metrics on the browsers and devices that are opening emails, as well as providing statistics based on geographic location or ISP. {% anchor h2 %} Get Statistics for: Browsers, Clients, Devices, Geo, Global, Isp {% endanchor %}

{% parameters get %} {% parameter 'data_type' 'Yes' 'One of the following:- browsers: Browser data obtained from click events- clients: Email client data obtained from open events- devices: Device data obtained from open events- geo: Geographical data obtained from multiple events- global: Global account data obtained from multiple events- isps: ISP data obtained from multiple events' %} {% parameter 'start_date' 'Yes' 'Date format is based on aggregated_by value (default is yyyy-mm-dd):- yyyy-mm-dd (i.e 2012-12-13) if aggregated_by=day (default)- yyyy-ww (i.e 2012-43) if aggregated_by=week- yyyy-mm (i.e 2012-11) if aggregated_by=month' %} {% parameter 'end_date' 'No' 'Date format is based on aggregated_by value (default is yyyy-mm-dd):- yyyy-mm-dd (i.e 2012-12-13) if aggregated_by=day (default)- yyyy-ww (i.e 2012-43) if aggregated_by=week- yyyy-mm (i.e 2012-11) if aggregated_by=month' %} {% parameter 'metric' 'No' 'One of the following (default is all):- open: Opens- click: Clicks- unique_open: Unique opens- unique_click: Unique clicks- processed: Processed emails- delivered: Delivered emails- drop: Dropped emails- bounce: Bounced emails- deferred: Deferred email tries- spamreport: Emails marked as spam- blocked: Emails that have been blocked- all: All metrics are returned' %} {% parameter 'category' 'No' 'Return stats for the given category' %} {% parameter 'aggregated_by' 'No' 'Aggregate the data by the given period (default is day):- day: Keys are returned in the format yyyy-mm-dd (i.e 2012-12-13)- week: Keys are return in the format yyyy-ww (i.e 2012-43)- month: Keys are return in the format yyyy-mm (i.e 2012-11)' %} {% parameter 'country' 'No' 'Get stats for each region/state for the given country. Only US (United States) and CA (Canada) is supported at this time. Country code is two letter characters based on ISO 3166-1 alpha-2

This parameter is only used for when data_type=geo

' %} {% endparameters %}

{% apiexample get POST https://api.sendgrid.com/api/stats.getAdvanced api_user=your_sendgrid_username&api_key=your_sendgrid_password&start_date=2013-01-01&end_date=2013-01-02&data_type=global %} {% response json %} [ { "delivered": 41, "request": 41, "unique_open": 1, "unique_click": 1, "processed": 41, "date": "2013-01-01", "open": 2, "click": 1 }, { "delivered": 224, "unique_open": 1, "request": 224, "processed": 224, "date": "2013-01-02", "open": 3 } ] {% endresponse %} {% response xml %} 41 41 1 1 41 2013-01-01 2 1 224 1 224 224 2013-01-02 3

{% endresponse %} {% endapiexample %}

Jump to Line
Something went wrong with that request. Please try again.