Create Campaign

Use the following to create an Analytics Campaign.

URL:

POST https://api.emailonacid.com/v5/analytics/createcampaign

Example Request Body:

{
    "name": "Sample Campaign Name",
    "transfer_encoding": "8bit",
    "charset": "utf-8",
    "total_subscribers": 2000,
    "read_threshold": 15,
    "skim_threshold": 7,
    "delete_threshold": 2,
    "merge_tag": "SAMPLE_MERGE_TAG",
    "click_tracking": {
        "google_analytics": true,
        "url": "",
        "html": ""
    },
    "customer_id": "Sample Customer ID"
}

Request Details:

Element Type Description Default
name String The name of the campaign, encoded as declared in transfer_encoding None; Required
transfer_encoding String One of base64, quoted-printable, 7bit, or 8bit. Default is 8bit; name and html should be encoded as described by this field.
charset String The character set your HTML is encoded in. Default is utf-8; name and html should be encoded as described by this field.
total_subscribers Integer The number of recipients planned for this campaign. This will determine many of your statistics such as % opens and % clicks. None; Required
read_threshold Integer Maximum number of seconds the user has the email open to have it classified as a 'read'. This is for purposes of evaluating customer engagement. 15
skim_threshold Integer Maximum number of seconds the user has the email open to have it classified as a 'skim'. This is for purposes of evaluating customer engagement. Beyond this, it counts as a 'read'. 7
delete_threshold Integer Maximum number of seconds the user has the email open to have it classified as a 'delete'. This is for purposes of evaluating customer engagement. Beyond this, it counts as a 'skim'. 2
merge_tag String

Merge tags allow us to track subscriber activity and provide segmentation analytics.

Most email service providers have some way for you to insert custom content into your email template via a 'merge tag'. For example Dear [first_name], but in our case, we need the unique email address, for example [email_address]. This address is inserted into the tracking code that we generate for you.

While optional, not including a merge tag could significantly reduce the granularity and accuracy of the data. Use of a merge tag in all campaigns is strongly encouraged.

None; Optional
click_tracking Object Use this setting to enable click tracking. As below. False; Optional
google_analytics Boolean If the links provided have Google Analytics, this setting will allow our link tracking to work seamlessly with their reporting. False; Optional
html String Email HTML source. None; Required if click_tracking element exists
Choice you can either use the this or the url tag listed below
url String Url of email source. None; Required if click_tracking element exists
Choice you can either use the this or the html tag listed above
customer_id String Enterprise customers can set this value for searching and internal reporting. None; Optional

Example Response:

{
    "guid": "<CAMPAIGN GUID>",
    "tracking_code": "",
    "customer_id": "Sample Customer ID"
}

Response Details:

Element Description
guid The unique identifier for this campaign. Use this identifier with the other Analytics API functions to get and update information for this campaign.
tracking_code Tracking code to be inserted into the email html source before sending. The tracking code should be placed just before the closing </body> tag of the email. If click tracking was enabled, the tracking code will be the entire html for the email with the tracking code already inserted.
customer_id Only included in the response if this was set when creating the campaign. Enterprise customers can set this value for searching and internal reporting.

 

Update Campaign

Updates information for a campaign that has already been created. If a campaign has already been activated only the campaign name and total_subscribers can be updated.

URL:

POST https://api.emailonacid.com/v5/analytics/updatecampaign

Example Request Body:

{
    "guid": "<CAMPAIGN GUID>",
    "name": "Sample Campaign Name",
    "total_subscribers": 2000,
    "read_threshold": 15,
    "skim_threshold": 7,
    "delete_threshold": 2,
    "merge_tag": "SAMPLE_MERGE_TAG",
    "click_tracking": {
      "google_analytics": true,
      "url": "",
      "html": ""
    }
}

Request Details:

Element Type Description Default
guid String The unique identifier for the campaign you are attempting to update. None; Required
name String The name of the campaign. None; Optional for updating the campaign name - encoded as declared in transfer_encoding
transfer_encoding String One of base64, quoted-printable, 7bit, or 8bit. Default is 8bit; name and html values should be encoded as described by this field
charset String The character set your HTML is encoded in. Default is utf-8; name and html values should be encoded as described by this field.
total_subscribers Integer The number of recipients planned for this campaign. This will determine many of your statistics such as % opens and % clicks. Optional, for updating total_subscribers
read_threshold Integer Maximum number of seconds the user has the email open to have it classified as a 'read'. This is for purposes of evaluating customer engagement. Optional, for updating read_threshold
skim_threshold Integer Maximum number of seconds the user has the email open to have it classified as a 'skim'. This is for purposes of evaluating customer engagement. Beyond this, it counts as a 'read'. Optional, for updating skim_threshold
delete_threshold Integer Maximum number of seconds the user has the email open to have it classified as a 'delete'. This is for purposes of evaluating customer engagement. Beyond this, it counts as a 'skim'. Optional, for updating delete_threshold
merge_tag String

Merge tags allow us to track subscriber activity and provide segmentation analytics.

Most email service providers have some way for you to insert custom content into your email template via a 'merge tag'. For example Dear [first_name], but in our case, we need the unique email address, for example [email_address]. This address is inserted into the tracking code that we generate for you.

While optional, not including a merge tag could significantly reduce the granularity and accuracy of the data. Use of a merge tag in all campaigns is strongly encouraged.

Optional, for updating merge_tag
click_tracking Object Use this setting to enable click tracking. As below. False, Optional. For updating click_tracking. Not including this on an 'updatecampaign' API call will default click tracking to false.
google_analytics Boolean If the links provided have Google Analytics, this setting will allow our link tracking to work seamlessly with their reporting. False; Optional. For updating google_analytics
html String Email HTML source. Optional; Required if click_tracking element exists
Choice you can either use the this or the url tag listed below
url String Url of email source. Optional; Required if click_tracking element exists
Choice you can either use the this or the html tag listed above

Example Response:

{
    "guid": "<CAMPAIGN GUID>",
    "tracking_code": ""
}

Response Details:

Element Description
guid The unique identifier for this campaign. Use this identifier with the other Analytics API functions to get and update information for this campaign.
tracking_code Tracking code to be inserted into the email html source before sending. The tracking code should be placed just before the closing </body> tag of the email. If click tracking was enabled, the tracking code will be the entire html for the email with the tracking code already inserted.

 

Activate Campaign

When a campaign is created, it is created in test mode. This function will activate the campaign and clear out any test data the campaign has. If you would like to activate the campaign and keep the test data, you can send a "keep_data" variable and set it to true. You may want to keep the test data if the campaign email has been sent out but the campaign was never activated.

URL:

POST https://api.emailonacid.com/v5/analytics/activatecampaign

Example Request Body:

{
    "guid": "<CAMPAIGN GUID>",
    "keep_data": true
}

Request Details:

Element Description Data Type Default
guid The unique identifier for the campaign you are activating. String None; Required
keep_data Set this variable to "true" if you would like to activate the campaign without clearing/deleting any test data. Boolean None; Optional. Required if you want to keep the test data.

Example Response:

{
    "success": true,
    "message": "Campaign successfully activated.",
    "guid": "<CAMPAIGN GUID>"
}

 

Clear Data

Clears out all data from a campaign. You cannot clear data from an active campaign.

URL:

POST https://api.emailonacid.com/v5/analytics/cleardata

Example Request Body:

{
    "guid": "<CAMPAIGN GUID>"
}

Request Details:

Element Type Description Default
guid String The unique identifier for the campaign you are attempting to clear data from. None; Required

 

Set Campaign Expiration

Sets the expiration date of the campaign.

URL:

POST https://api.emailonacid.com/v5/analytics/setcampaignexpiration

Request:

{
    "guid": "<CAMPAIGN GUID>",
    "date": "<YYYY-MM-DD>"
}

Request Details:

Element Description Data Type Default
guid The unique identifier for the campaign you are attempting to update. String None; Required
date Date to set the campaign to expire.
Date format must be in "YYYY-MM-DD".
Campaign cannot be set to expire within 30 days of the start date.
Campaign connot be set to expire more than 3 years after the start date.
Date Formatted String None; Required