Get email analytics
  • 08 Dec 2023
  • 4 Minutes to read

    Get email analytics


      Article Summary

      Overview

      This API enables you to get the following data from your back-end without using Insider's platform:

      The email campaigns sent through Architect journeys are not included in Email Analytics. You can get insights about your journey emails via Architect Email Channel Analytics.

      Get Email Campaign List

      This request allows you to get a full list of your available email campaigns.

      Your title goes here
      The campaigns on the Draft and Scheduled statuses are not listed in the response.

      Endpoint and Headers

      GET https://analytics.api.useinsider.com/email/v1/campaign/list

      Headers

      HeaderSample ValueDescription
      X-INS-AUTH-KEY1a2b3c4d5e6fThis key is required to authorize your request. Refer to API Authentication Tokens to generate your token.

      Query Parameters

      ParameterData TypeDescriptionRequired
      pageIntegerSpecifies the number of pages of email campaignsYes
      perPageIntegerSpecifies the number of emails to be listed per pageYes

      Sample Example

      Sample Query

      Before sending the request, make sure:

      • To replace the authorization value with your own API key.
      • To replace the sample values in page and perPage with your own values in the required data type.
      curl --location --request GET 'https://analytics.api.useinsider.com/email/v1/campaign/list?page=1&perPage=100' \
      2--header 'X-INS-AUTH-KEY: 1a2b3c4d5e6f'

      Sample Responses

      • 200 OK
      {
          "currentPage": 1,
          "data": [
              {
                  "id": 67,
                  "campaignName": "My awesome campaign",
                  "startTime": "01-01-2023 12:30:15"
              },
              {
                  "id": 66,
                  "campaignName": "This is a great campaign",
                  "startTime": "01-12-2022 09:30:17"
              },
              {
                  "id": 65,
                  "campaignName": "This is a recurring campaign",
                  "startTime": "12-12-2022 12:45:15"
              },
              {
                  "id": 64,
                  "campaignName": "This is a newsletter",
                  "startTime": "22-07-2022 16:00:01"
              },
              {
                  "id": 63,
                  "campaignName": "My email campaign",
                  "startTime": "01-01-2022 18:30:00"
              }
          ],
          "firstPageUrl": "https://analytics.useinsider.com/email/v1/campaign/list?page=1&perPage=5",
          "from": 0,
          "lastPage": 14,
          "lastPageUrl": "https://analytics.useinsider.com/email/v1/campaign/list?page=14&perPage=5",
          "nextPageUrl": "https://analytics.useinsider.com/email/v1/campaign/list?page=2&perPage=5",
          "path": "/email/v1/campaign/list",
          "perPage": 5,
          "prevPageUrl": "https://analytics.useinsider.com/email/v1/campaign/list?page=1&perPage=5",
          "to": 0,
          "total": 67
      }
      • 400 - Bad Request: Sorry, we’ve received an invalid request from your side. You can try again later.
      • 400 - Bad Request: Sorry, we couldn’t validate the request at the moment. You can try again later.
      • 500 - Internal Server Error: Sorry, we couldn’t receive any response from our server. You can try again later.

      Get Email Campaign Analytics

      This request allows you to get the analytics of your email campaigns for a given time period.

      Your title goes here
      The campaigns on the Draft and Scheduled statuses are not listed in the response.

      Endpoint and Headers

      GET https://analytics.api.useinsider.com/email/v1/campaign/statistics

      Headers

      HeaderSample ValueDescription
      X-INS-AUTH-KEY1a2b3c4d5e6fThis key is required to authorize your request. Refer to API Authentication Tokens to generate your token.

      Query Parameters

      ParameterData TypeDescriptionRequired
      campaignIdIntegerYour campaign ID that can be found on the campaign URL.Yes
      startTimeint64The time campaign is being launched. Specifies a 10-digit epoch start time.Yes
      endTimeint64The current date (today’s date on the payload). It can be customizable according to your use case. Specifies a 10-digit epoch start time.No
      Your title goes here
      If the endTime value is empty, it will be populated with today’s date and time in UTC.

      Sample Example

      Sample Query

      Before sending the request, make sure: 

      • To replace the authorization value with your own API key.
      • To replace the sample values in campaignID, startTime, and endTime with your own values in the required data type.
      curl --location --request GET 'https://analytics.api.useinsider.com/email/v1/campaign/statistics?campaignId=3388&startTime=1619459200&endTime=1636502400' \
      2--header 'X-INS-AUTH-KEY: 1a2b3c4d5e6f'
      

      Sample Responses

      • 200 OK
      {
          "data": {
              "details": {},
              "summary": {
                  "blocks": 300,
                  "bounces": 0,
                  "clickRate": 1.45,
                  "clickToOpen": 2860,
                  "conversion": 22,
                  "conversionRate": 0.01,
                  "delivered": 235746,
                  "frequencyDrop": 0,
                  "invalid": 0,
                  "linkActivities": [
                  {
                      "totalClick": 1,
                      "uniqueClick": 1,
                      "url": "https://google.com"
                  }
              ],
                  "machineOpen": 0,
                  "openRate": 6.48,
                  "revenue": 0,
                  "sendingDrop": 0,
                  "sent": 236573,
                  "spams": 2,
                  "systemDrop": 0,
                  "totalClick": 4931,
                  "totalOpen": 64518,
                  "uniqueClick": 3429,
                  "uniqueOpen": 15272,
                  "unsubscribes": 100
              }
          }
      }
      • 400 - Bad Request: Sorry, we’ve received an invalid request from your side. You can try again later.
      • 400 - Bad Request: Sorry, we couldn’t validate the request at the moment. You can try again later.
      • 400 - Bad Request: Sorry, we detected an invalid Campaign ID in your request. The Campaign ID is not found in the database. You can confirm your Campaign ID by checking the InOne panel.
      • 406 - Not Acceptable Request: Sorry, we received an invalid request. We are able to provide the analytics data for only the last 1 year.
      • 500 - Internal Server Error: Sorry, we couldn’t receive any response from our server. You can try again later.

      Get Overall Analytics

      This request allows you to get the overall analytics of your email campaigns for a given time period.

      Your title goes here
      The campaigns on the Draft and Scheduled statuses are not listed in the response.

      Endpoint and Headers

      GET https://analytics.api.useinsider.com/email/v1/overall

      Headers

      HeaderSample ValueDescription
      X-INS-AUTH-KEY1a2b3c4d5e6fThis key is required to authorize your request. Refer to API Authentication Tokens to generate your token.

      Query Parameters

      ParameterData TypeDescriptionRequired
      startTimeint64The time campaign is being launched. Specifies a 10-digit epoch start time.Yes
      endTimeint64The current date (today’s date on the payload). It can be customizable according to your case. Specifies a 10-digit epoch start time.No

      Sample Example

      Sample Query

      Before sending the request, make sure:

      • To replace the authorization value with your own API key.
      • To replace the sample values in start_date and end_date with your own values in the required data type.
      curl --location --request GET 'https://analytics.api.useinsider.com/email/v1/overall?startTime=1635714000&endTime=1646502400' \
      2--header 'X-INS-AUTH-KEY: 1a2b3c4d5e6f'

      Sample Responses

      • 200 OK
      {
          "data": {
              "summary": {
                  "blocks": 0,
                  "bounceDrop": 0,
                  "bounces": 0,
                  "clickRate": 5.88,
                  "conversion": 0,
                  "conversionRate": 0,
                  "delivered": 17,
                  "frequencyDrop": 0,
                  "invalid": 0,
                  "invalidDrop": 0,
                  "machineOpen": 0,
                  "openRate": 47.05,
                  "revenue": 0,
                  "sendingDrop": 0,
                  "sent": 27,
                  "spamDrop": 0,
                  "spams": 0,
                  "systemDrop": 0,
                  "totalClick": 1,
                  "totalOpen": 15,
                  "unsubscribeDrop": 0,
                  "unsubscribes": 0
              },
              "linkActivities": [
                  {
                      "totalClick": 1,
                      "uniqueClick": 1,
                      "url": "https://google.com"
                  }
              ]
          }
      }
      • 400 - Bad Request: Sorry, we’ve received an invalid request from your side. You can try again later.
      • 400 - Bad Request: Sorry, we couldn’t validate the request at the moment. You can try again later.
      • 429 - Rate Limited: Rate limited
      • 500 - Internal Server Error: Sorry, we couldn’t receive any response from our server. You can try again later.

      Limitations

      • All functions must be executed with an HTTPS GET request.
      • The x-ins-auth-key should be provided as the authorization key on the request header. If the key is incorrect, the operation will not be executed and an authorization error will return in the response.
      • This API provides data for a 1 year-range.
      • You can send 100 requests/per minute with the same API Key. If you exceed the rate limit, you will receive a 429 error.
      • The perPage value should be between 1-100.

      Was this article helpful?

      What's Next
      ESC

      Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses