The Report Tracked Events by Campaign command allows you to return a list of contacts for any tracked event in a date range for a specific campaign.
NOTE: As of revision 13.0.0, the rpt_tracked_events_by_campaign command no longer supports returning all events in a single call. You must use the specific event type ID, found in Event Types.
The Report Tracked Events by Campaign command requires the following arguments: Command, Realm, Password, Campaign ID, Event Type, Offset, Start (From) Date, and End (To) Date:
api_web?r=myrealm&p=mypass&c=rpt_tracked_events_by_campaign&campaign_id=11&event_type=0&offset=0&start_datetime=06/20/2012%2000:00:00&end_datetime=06/20/2012%2011:59:59
The command is ‘rpt_tracked_events_by_campaign’, the realm is ‘myrealm’ and the password is ‘mypass’. The command will return every tracked event that occured for campaign_id '11' from 12:00 am on June 20, 2012 to just before midnight on the same day starting with the first result (offset=0). The report will include the first 250 events with the following details:
"campaign_id","campaign_alias","list_id","list_name","subscriber_id","email","first_name","last_name","event_date","event_type"
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?c=rpt_tracked_events_by_campaign&r=myrealm&p=mypass&campaign_id=11&event_type=9&offset=0&start_datetime=06/20/2012%2000:00:00&end_datetime=06/20/2012%2011:59:59&version=8.4.0&output_format=csv&headers=1
Successful results return:
"campaign_id","campaign_alias","list_id","list_name","subscriber_id","email","first_name","last_name","event_date","event_type","meta_data","tracking_id"
"11","","80","List","13","jack@myemail.com","Jack","Sprat","2012-06-20 10:48:25","9","","32" "11","","80","List","14","jane@myemail.com","Jane","Doe","2012-06-20 10:48:25","11","http://www.mysite.com","33"
Some systems have the ability to define a unique Customer Key per contact. If your realm has Customer Key enabled, and additional column "customer_key" will be included in the results.
Results
The Report Tracked Events by Campaign command outputs either the results of the search or a FAILURE message.
SUCCESS
The Report Tracked Events by Campaign command does not explicitly return a Success code. Instead, it outputs the campaign id, list name, subject, date sent, and number of recipients in plain text format. Use the output_format argument to return the following data results in an alternate format:
"campaign_id","campaign_alias","list_id","list_name","subscriber_id","email","first_name","last_name","event_date","event_type","meta_data","tracking_id"
FAILURE
A Report Tracked Events by Campaign command will fail for several reasons, such as if the date is invalid or the campaign doesn't exist. The result format is:
FAILURE: [Reason]
Artuments
The Report Tracked Events by Campaign command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd= rpt_tracked_events_by_campaign c=rpt_tracked_events_by_campaign |
Realm |
Yes |
Name of the realm to run the command. This is required, and the command will fail if the realm and password do not match. |
realm=[realm_name] r=[realm_name] |
Password |
Yes |
Authentication code for API access. This is required, and the command will fail if the realm and password do not match. |
pwd=[password] p=[password] |
Campaign ID | Yes | Identifier for the campaign data to return. | campaign_id=[campaign_id] |
Event Type | Yes |
Identifier for the type of the single, specific event to report. To report all events regardless of type, use 0. The argument does not support a comma delimited list of specific events. See Event Types for accepted values. NOTE: event_type=0 is no longer valid as of v13.0.0 |
event_type=[event_type_id]
|
Start Date | Yes | Date to start reporting statistics |
start_datetime=[mm/dd/yyyy%20hh:mm:ss] |
End Date | Yes | Date to end reporting statistics | end_datetime=[mm/dd/yyyy%20hh:mm:ss] |
Offset | Yes | The starting point from which to return results. The maximum result for each call is 250 contacts. For example, offset=0 returns the first 250 results, and offset=250 returns the next 250 results. Offset is in multiples of 250. | offset=[0,250,500,etc.] |
Tracking ID | Include the tracking_id to limit the results to a single tracking event. This argument is not supported after v10.0.0 release. | tracking_id=[tracking_id] | |
Version | Version of API to use. Data may be added to newer versions of the API. To alleviate issues for users who have already coded file parsing, new columns are only displayed if the version is included. |
version=[version_number] 8.4.0 = meta_data for clicks and bounces
|
|
Output Format |
|
To specify the format of the list output, use one of two arguments. If no argument is included, the default output is space-delimited plain text string, which may not include all data columns. |
csv=1 or output_format=[csv,csv_tab, csv_pipe,xml] |
Header |
|
To define the data with a label, use the Header argument. This can only be used in conjunction with the output format, and does not affect XML. |
headers=[0,1] DEFAULT==0 |
Comments