cancel
Showing results for 
Search instead for 
Did you mean: 

Campaign Unsubscribe Reason not showing in the API result data

Occasional Contributor

Campaign Unsubscribe Reason not showing in the API result data

When I pull the result data using the API and supplying the campaignid - I don't see the unsubscribe_reason with any data (all ""), even though it shows on the web front end if you click on the details of the unsubscribes. The emails and the click event time come through fine.

 

Thanks

 

6 REPLIES 6
Honored Contributor

Re: Campaign Unsubscribe Reason not showing in the API result data

Hello,

 

The "unsubscribe_reason" field is only populated when the contact chooses to leave a message detailing the reason that they unsubscribed.

 

Here's an example of what it would look like if the contact left the message "testing" in the optional message field:

        {
            "activity_type": "EMAIL_UNSUBSCRIBE",
            "campaign_id": "1120354154567",
            "contact_id": "1640536544",
            "email_address": "email@example.com",
            "unsubscribe_date": "2016-07-07T18:52:00.000Z",
            "unsubscribe_source": "ACTION_BY_CONTACT",
            "unsubscribe_reason": "testing"
        }

Please let me know if you have any questions or issues!

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Contributor

Re: Campaign Unsubscribe Reason not showing in the API result data

I understand it only exists if they type it in.

 

However, if I'm using the web interface, click on a campaign, then click on unsubscribes - there may be a couple entries that have a reason.

When I use the API to pull the detail of unsubscribes of a specific campaignid - those contacts that had reasons on the web interface do not have anything populated in the unsubscribe_reason element returned in the JSON feed. (nor in the API test page for that campaignid also)

 

I can't post specifics for privacy reasons - should this go to support email?

 

 

Highlighted
Honored Contributor

Re: Campaign Unsubscribe Reason not showing in the API result data

I did a bit more digging on this, and I found that I was able to get the unsubscribe reason when accessing the data from /v2/contacts/CONTACTID/tracking/unsubscribes, but the reason did not appear when accessing the data from /v2/emailmarketing/campaigns/CAMPAIGNID/tracking/unsubscribes.

 

I'm going to do a bit more digging on this to see what I can find. It's likely that I won't have an answer for you on this before tomorrow.

 

Sincerely,

Elijah G.
API Support Engineer
Regular Visitor

Re: Campaign Unsubscribe Reason not showing in the API result data

Apologies for resurrecting a dead thread, but it's going on four months later and still no fix for this bug???

Honored Contributor

Re: Campaign Unsubscribe Reason not showing in the API result data

Hello,

 

I spent some time this morning going back and looking into this. The ultimate source of the discrepancy here is that the internal service calls and the data requested is slightly different for contact tracking and campaign tracking. In this case, the opt out reason is specifically associated with the contact rather than the campaign, so it is not pulled when you request campaign tracking data.

 

After looking into the code for this, it appears that it would be quite an undertaking to address this discrepancy for the V2 API. However, I will absolutely follow up with our product leadership team and see what we can do!

 

Sincerely,

Elijah G.
API Support Engineer
Regular Visitor

Re: Campaign Unsubscribe Reason not showing in the API result data

Thank you for your quick response. I will look into using the suggested workaround.

 

May I suggest you change the API documentation to remove mention of the unsubscribe reason field?