OnSite Analytics
  • 08 Mar 2024
  • 4 Minutes to read

    OnSite Analytics


      Article Summary

      Overview

      This API enables you to get on-site campaigns & overall analytics of your on-site campaigns from your own back-end without using Insider’s platform.

      Campaign Analytics Endpoint and Headers

      Campaign analytics give you the results of the campaign for the time period you selected.

      GET http://analytics.api.useinsider.com/onsite/v1/campaign

      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
      startTimeint64Specifies a 10-digit epoch start timeYes
      endTimeint64Specifies a 10-digit epoch end timeNo
      campaignBuilderIdIntegerYour campaign builder IDYes

      Sample Example

      Sample Query

      Before sending the request, make sure:

      • To replace the authorization value with your own On-site Campaign Analytics API key.
      • To replace the sample values in campaignBuilderId, startTime, and endTime with your own values in the required data type.
      curl --location --request GET 'analytics.api.useinsider.com/onsite/v1/campaign?startTime=1633471200&endTime=1649195999&campaignBuilderId=2877'
      2--header 'X-INS-AUTH-KEY: 1a2b3c4d5e6f'

      Sample Responses

      • 200 OK
      
      {
         "data": {
             "detail": {
                 "9": {
                     "87": [
                         {
                             "conversion": 166400.0,
                             "significance": 0.0,
                             "averageOrderValueUplift": 0.0,
                             "bayesianSignificance": 0.9999,
                             "leadCount": 0,
                             "goalConversionRate": 0.3853082697713621,
                             "incrementalConversion": 0.0,
                             "averageOrderValue": 0.0,
                             "goal": "9",
                             "salesConversion": 229.0,
                             "conversionRateUplift": 0.0,
                             "incrementalRevenue": 0.0,
                             "goalConversion": 166400.0,
                             "revenue": 0.0,
                             "conversionRate": 0.3853082697713621,
                             "salesConversionRate": 0.0005302619818367904,
                             "campaignId": 87,
                             "campaignName": "My campaign",
                             "platform": "all",
                             "impression": 431862.0
                         }
                     ],
                     "88": [
                         {
                             "conversion": 105743.0,
                             "significance": 0.9999199999999999,
                             "averageOrderValueUplift": 0.0,
                             "bayesianSignificance": 0.0,
                             "leadCount": 0,
                             "goalConversionRate": 0.36993125645017405,
                             "incrementalConversion": 0.0,
                             "averageOrderValue": 0.0,
                             "goal": "9",
                             "salesConversion": 137.0,
                             "conversionRateUplift": 0.0,
                             "incrementalRevenue": 0.0,
                             "goalConversion": 105743.0,
                             "revenue": 0.0,
                             "conversionRate": 0.36993125645017405,
                             "salesConversionRate": 0.00047928072906645207,
                             "campaignId": 88,
                             "campaignName": "My campaign 2",
                             "platform": "all",
                             "impression": 285845.0
                         }
                     ]
                 }
             },
             "summary": {
                 "87": 39,
                 "88": 35
             }
         }
      }

      In the summary object:

      • Keys (e.g. 87, 88 as in the example above) represent the email variation IDs,
      • Values (e.g. 39, 35 as in the example above) )represent the Effective Days, the number of days when email variant had been viewed more than 10 times. 
      • 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.
      • 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.

      Overall Analytics Endpoint and Headers

      Overall analytics give you all the results for the time period selected together with the filters applied. If you select the value of the reportType as summary, you receive a summarized response while you get a detailed result for the personalizations including more values when you select detail for the same request.

      GET http://analytics.api.useinsider.com/onsite/v1/all

      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
      startTimeint64Specifies a 10-digit epoch start timeYes
      endTimeint64Specifies a 10-digit epoch end timeNo
      campaignReportTypeStringYour campaign report time. Its values can be "ab", "hundred".Yes
      selectedGoalTypeStringYour goal type of the data. Its values can be "sales", "click", "salesFromClick".Yes
      reportTypeStringYour report type for the data to be fetched. Its values can be "detail", "summary".Yes

      Sample Example

      Sample Query

      Before sending the request, make sure:

      • To replace the authorization value with your own On-site Campaign Analytics API key.
      • To replace the sample values in startTime, endTime, campaignReportType, selectedGoalType, and reportType with your own values in the required data type.
      curl --location --request GET 'http://analytics.api.useinsider.com/onsite/v1/all?startTime=1650067200&endTime=1652804845&campaignReportType=ab&selectedGoalType=click&reportType=summary'
      2--header 'X-INS-AUTH-KEY: 1a2b3c4d5e6f'

      Sample Responses

      • 200 - OK
      {
         "data": {
             "details": [
                 {
                     "significance": 0.9999199999999999,
                     "averageOrderValueUplift": 0.2002548803800035,
                     "bayesianSignificance": 0.9999,
                     "builderType": "custom",
                     "selectedGoalConversionRate": 0.0661764705882353,
                     "revenueFromClick": 190622.0,
                     "selectedGoalConversion": 288.0,
                     "selectedGoalId": 0,
                     "incrementalConversion": 124.39097744360902,
                     "clickThroughRate": 0.0,
                     "averageOrderValue": 259.0,
                     "activeDays": 32,
                     "goalId": 0,
                     "salesConversion": 288.0,
                     "conversionRateUplift": 0.760294117647059,
                     "incrementalRevenue": 39287.21804511278,
                     "clickConversion": 0.0,
                     "revenue": 74592.0,
                     "salesConversionRate": 0.0661764705882353,
                     "campaignId": 6,
                     "campaignName": "My campaign",
                     "impression": 4352.0,
                     "salesFromClick": 736.0
                 },
                 {
                     "significance": 0.0,
                     "averageOrderValueUplift": 0.0,
                     "bayesianSignificance": 0.0,
                     "builderType": "custom",
                     "selectedGoalConversionRate": 0.03759398496240601,
                     "revenueFromClick": 6905.0,
                     "selectedGoalConversion": 160.0,
                     "selectedGoalId": 0,
                     "incrementalConversion": 0.0,
                     "clickThroughRate": 0.15037593984962405,
                     "averageOrderValue": 215.7875,
                     "activeDays": 32,
                     "goalId": 0,
                     "salesConversion": 160.0,
                     "conversionRateUplift": 0.0,
                     "incrementalRevenue": 0.0,
                     "clickConversion": 640.0,
                     "revenue": 34526.0,
                     "salesConversionRate": 0.03759398496240601,
                     "campaignId": 5,
                     "campaignName": "My amazing campaign",
                     "impression": 4256.0,
                     "salesFromClick": 32.0
                 },
                 {
                     "significance": 0.9999199999999999,
                     "averageOrderValueUplift": 0.4096872064857382,
                     "bayesianSignificance": 0.9999,
                     "builderType": "campaign",
                     "selectedGoalConversionRate": 0.045020463847203276,
                     "revenueFromClick": 49774.0,
                     "selectedGoalConversion": 1056.0,
                     "selectedGoalId": 0,
                     "incrementalConversion": 252.71232876712338,
                     "clickThroughRate": 0.17053206002728513,
                     "averageOrderValue": 259.24147727272725,
                     "activeDays": 32,
                     "goalId": 0,
                     "salesConversion": 1056.0,
                     "conversionRateUplift": 0.31459754433833576,
                     "incrementalRevenue": 126034.39726027398,
                     "clickConversion": 4000.0,
                     "revenue": 273759.0,
                     "salesConversionRate": 0.045020463847203276,
                     "campaignId": 11,
                     "campaignName": "My great campaign",
                     "impression": 23456.0,
                     "salesFromClick": 192.0
                 },
                 {
                     "significance": 0.0,
                     "averageOrderValueUplift": 0.0,
                     "bayesianSignificance": 0.0,
                     "builderType": "campaign",
                     "selectedGoalConversionRate": 0.03424657534246575,
                     "revenueFromClick": 17654.0,
                     "selectedGoalConversion": 800.0,
                     "selectedGoalId": 0,
                     "incrementalConversion": 0.0,
                     "clickThroughRate": 0.1506849315068493,
                     "averageOrderValue": 183.9,
                     "activeDays": 32,
                     "goalId": 0,
                     "salesConversion": 800.0,
                     "conversionRateUplift": 0.0,
                     "incrementalRevenue": 0.0,
                     "clickConversion": 3520.0,
                     "revenue": 147120.0,
                     "salesConversionRate": 0.03424657534246575,
                     "campaignId": 10,
                     "campaignName": "My awesome campaign",
                     "impression": 23360.0,
                     "salesFromClick": 96.0
                 },
                 {
                     "significance": 0.93424,
                     "averageOrderValueUplift": 0.24425137862865465,
                     "bayesianSignificance": 0.967,
                     "builderType": "campaign",
                     "selectedGoalConversionRate": 0.03529411764705882,
                     "revenueFromClick": 11958.0,
                     "selectedGoalConversion": 192.0,
                     "selectedGoalId": 0,
                     "incrementalConversion": 33.86046511627907,
                     "clickThroughRate": 0.21176470588235294,
                     "averageOrderValue": 373.703125,
                     "activeDays": 32,
                     "goalId": 0,
                     "salesConversion": 192.0,
                     "conversionRateUplift": 0.21411764705882352,
                     "incrementalRevenue": 24254.779069767443,
                     "clickConversion": 1152.0,
                     "revenue": 71751.0,
                     "salesConversionRate": 0.03529411764705882,
                     "campaignId": 15,
                     "campaignName": "My perfect campaign",
                     "impression": 5440.0,
                     "salesFromClick": 32.0
                 }
             ],
             "goalIdList": []
         }
      }
      • 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.

      Limitations

      • All functions must be executed with an HTTPSGET 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.

      Was this article helpful?

      ESC

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