1

I'm currently using the Marketing Cloud SOAP API to get metrics about emails I send out. This works fine, I am able to get single instances of every event, but

I am struggling with relating the send back to the email template used for the email.

I am able to send a retrieve request to get all email templates with the following request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <fueloauth xmlns="https://exacttarget.com">***AUTH_TOKEN HERE***</fueloauth>
    </soapenv:Header>
    <soapenv:Body>
        <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <RetrieveRequest>
                <ObjectType>Email</ObjectType>
                <Properties>ID</Properties>
                <Properties>Name</Properties>
                <Properties>Subject</Properties>
                <Properties>Status</Properties>
                <Properties>PartnerKey</Properties>
                <Properties>CreatedDate</Properties>
                <Properties>Folder</Properties>
                <Properties>CategoryID</Properties>
                <Properties>EmailType</Properties>
                <!--<Properties>HTMLBody</Properties>-->
                <Properties>ContentAreas</Properties>
            </RetrieveRequest>
        </RetrieveRequestMsg>
    </soapenv:Body>
</soapenv:Envelope>

And I can get metrics for each event such as Open, clicks, unsubscribes, etc. with the following request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <fueloauth xmlns="https://exacttarget.com">***AUTH_TOKEN HERE***</fueloauth>
    </soapenv:Header>
    <soapenv:Body>
        <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <RetrieveRequest>
                <!-- Replace SentEvent with other desired metrics -->
                <ObjectType>SentEvent</ObjectType>
                <Properties>SubscriberKey</Properties>
                <Properties>TriggeredSendDefinitionObjectID</Properties>
                <Properties>SendID</Properties>
                <Properties>BatchID</Properties>
                <Properties>EventType</Properties>
            </RetrieveRequest>
        </RetrieveRequestMsg>
    </soapenv:Body>
</soapenv:Envelope>

Is there any possible way to relate the data I get for the metrics back to the email template that was used. Is there a property that I am missing?

Thanks you.

1 Answer 1

2

You need to link on the TriggeredSendDefinitionObjectID. Each email is sent out via Triggered Send. You can make a SOAP Retrieve for a TriggeredSendDefinition based upon TriggeredSendDefinitionObjectID in your SendEvents. The TriggeredSendDefinition will contain information about the Email that was linked.

https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/triggeredsenddefinition.htm

2
  • 1
    If not a trigger, you would link using 'SendId' which equals 'JobId' Jun 18, 2019 at 11:18
  • Thank you so much!
    – Conor
    Jun 18, 2019 at 13:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .