3

I've written a small test C# application to extract tracking information (opens, bounces, clicks and unsubscribes) for a specified date from the ExactTarget API. Ultimately, this data will be imported back into a CRM system and will be used in reporting as well as future campaigns.

Each of the extract files contain a Send Id field which I know is the identifier for the particular send of the email campaign. However, I need to be able to relate this back to the campaign itself in the CRM system so that I can report on number of opens etc. per campaign and not per send (as the CRM system will know about the campaigns but not about the sends).

I've spent a fair bit of time looking through the API documentation and trying things, but I am struggling to see how I can either include the campaign id, code or name in the tracking extracts or, alternatively, make an additional API call to get the campaign id, code or name for a given Send Id. Sends and campaigns must be linked in the database behind the scenes as I can go into the ExactTarget web portal and see all the sends for a given campaign, but I need to get at this information through the API.

This is really quite urgent as I'm currently trying to finish off functional requirements for this project so if anyone can help me, it would be much appreciated.

Thanks

4

In a prior ExactTarget-integrated partner role, we had similar client instances where, if we needed to link a send to a customer-defined campaign name, campaign type, etc., we would enable the Additional_Email_Attributes business rule within the ExactTarget the account. *(This feature was initially built for the ExactTarget web analytics connectors; More info here: https://help.exacttarget.com/en-US/documentation/integrated_products__crm_and_web_analytic_solutions/web_analytics_connector/ )*

We would then be able to retrieve via the API all tracking details on a send, including those values entered into those Additional_Email_Attributes, and deliver aggregate the reporting details to the customer based on those addtl attributes—which were really just naming tags.

Would this accomplish your objectives?

| improve this answer | |
  • That sounds promising - I'll see if I can get the client to enable this business rule and try it out. Thanks! – Lindsey Menzies Mar 13 '14 at 13:31
  • The client has now enabled this business rule and has set an additional attribute on one of their emails. However, when I retrieve a previous send for that email, the "Additional" field is empty - is this the correct field to be trying to retrieve? If so, does it only work on sends after the attribute was set? – Lindsey Menzies Mar 19 '14 at 9:37
  • Yes, that is the correct field, but I do not believe it is retroactive to past sends. Try a quick test send, and see if you can retrieve that value via the API – jwachs Mar 19 '14 at 19:18
4

After much head scratching, trawling through the API documentation, messing about with API calls and frustrated emails to Exact Target support, I finally found a solution to my problem...the SendAdditionalAttribute API object, which allows you to get at those additional email attributes that jwachs mentioned using a Retrieve request. So here's my solution, for anyone who is interested.

Firstly, as per my original post, I'm going to retrieve the tracking files for a date range as this suits the requirements much better than doing it per send. The data in the extracts will be imported into SQL Server so it will be easy from there to determine the unique Send Ids contained within a file and I plan to maintain a lookup table within SQL Server which has a mapping from Send Id to the unique name for the email/campaign.

The client has enabled the additional email attributes business rule and will add unique campaign/email codes to every email they have set up in the past as well as all those going forward. Then, in order to maintain my lookup table, I just need to make a Retrieve API call on the SendAdditionalAttributes object, filtering by each new Send Id returned in the tracking files in turn. And once I have the lookup table, I can easily report on tracking results per campaign/email instead of per send.

| improve this answer | |
0

There are a couple steps you will want to do here to retrieve the tracking per campaign:

First, in order to get the emails by campaign, you would need to use the following REST route:

GET https://www.exacttargetapis.com/hub/v1/campaigns/{ID}/assets

Where ID is the campaign's ID. This will return an array of objects that will allow you to grab all entity types by email, and return their ID's. You can try this out here.

Once you have that, you would then need to perform the tracking event retrieves via the SOAP API, and you would simply loop through the collection of ID's you gathered in the previous step.

Updated

So this only gets you the email ID - and the routes to allow for this to actually work with sends is not yet publicly available.

| improve this answer | |
  • The problem with this approach is that it means going through all campaigns every time I want to get tracking information as tracking events can happen for some time after a campaign - and also because I won't know the campaign id as that's generated in ExactTarget and won't be available in my CRM database. What I need to be able to do is get all events for a given day (this will be automated to run every day) and then get back to the campaign id from there - I really hope this is possible, somehow. – Lindsey Menzies Mar 11 '14 at 13:54
  • Unfortunately no. The email object is currently under aware of its campaign. You could potentially store the information required for later use, so you only need to do it once. I wish there was a better way, but from what I know, this is it. – Kelly J Andrews Mar 11 '14 at 13:59
  • Actually, I've had a deeper look into this now and I don't believe it gives me what I need, even as a lookup table. The REST API call would give the Email Ids associated with a campaign - but the tracking files are by send, not by email so the Email Id doesn't actually help, I don't think, unless there's another REST (or SOAP) call I can make to get Send Ids by Email Id? – Lindsey Menzies Mar 12 '14 at 9:33
  • Ugh - I was thinking we could get back to the tracking events by email ID. I'm still looking, but I think you may be right and I'll need to find an alternative. – Kelly J Andrews Mar 12 '14 at 15:03
0

To any that stumble across this here's how I solved it:

Rest API:

  • get campaigns
  • get each campaign's assets (includes emails)

Soap API:

  • Request triggeredSendDefinition (include Email.ID and ObjectID)
  • Request triggeredSendSummaries (link to definition via ObjectID)

Which allows you to connect:

campaign (camapgin_id)> asset (email_id/Email.ID)> triggerdSendDefinition (ObjectID)> triggeredSendSummary

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.