Blueshift automatically unsubscribes customers when they click on the unsubscribe link in the footer or headers in an email sent from a campaign. However, there may be scenarios where you may want to manually unsubscribe customers.

  Note

Blueshift does not send any messages to customers who have unsubscribed from a channel. To send messages to customers who have unsubscribed, use the override options in the campaign properties. For example, if you have a transactional campaign, you might want to send messages to customers who have otherwise unsubscribed.

Unsubscribed attributes

Here are the standard attributes used by Blueshift to indicate the subscription status for a customer. Additionally, you can also add any custom attributes to manage your subscriptions.

Email unsubscribed

unsubscribed_at

(This is set automatically when we receive the unsubscribed event)

Push unsubscribed_push unsubscribed_push_at
In-app unsubscribed_inapp unsubscribed_inapp_at
SMS unsubscribed_sms unsubscribed_sms_at
Standard Attributes opted_in opted_in_at

Send unsubscribe data

You can send unsubscribe data to Blueshift using any of the following methods:

Unsubscribes for SMS

  Note

It is important that all your customer phone numbers are saved in the E.164 standard.

In case of phone number based subscription management, when a subscribe or unsubscribe is received from a phone number, Blueshift searches for the customer based on the phone number field. Most SMS vendors use the E.164 format for phone numbers. If you have not used the same format to save phone numbers for your customers, Blueshift might not be able to find and update the right customer. 

For example, if we receive an unsubscribe message from +14152302112 and you have added the phone number as (415) 230-2112, we will not be able to match them and the customer will not be unsubscribed.

Self-Hosted Unsubscribe Pages

In a self-hosted unsubscribe page setup, instead of using {{unsubscribe_link}}, customers are directed to a custom URL where unsubscribe_link is passed as a URL parameter. In this way you can record the unsubscribe action in Blueshift and ensure that campaign attribution is preserved.

For example:

<a bsft-no-track href="https://www.example.com/imaginary_unsubscribe_page?customer_id={{user.customer_id}}&bsft_unsub={{unsubscribe_link | url_encode}}">Unsubscribe<a>

Note: "bsft-no-track" must be present in order for this to work.

Example of a formatted URL:

https://www.example.com/imaginary_unsubscribe_page?bsft_unsub=https%3A%2F%2Funiversallinks.blueshiftreads.com%2Fcustomer%2Funsubscribe%3Fuid%3De6afc3fc-f3e9-4142-836b-50cbb05c5e55%26mid%3Dcdf1727f-bdec-462b-9969-23f18d859a18%26txnid%3D99af1bf5-969e-416f-b331-917eff4617b7%26eid%3D433b295e-cdfe-0f5a-5cca-cfa46f6809fc%26bsft_ek%3D2021-04-26T19%253A15%253A46Z%26bsft_aaid%3D48400530-21e4-4403-826c-d50cc97d18b7%26bsft_mime_type%3Dhtml%26bsft_link_id%3D4%26bsft_tv%3D5%26bsft_lx%3D4

Backend handling is required for this request to decode the bsft_unsub parameter and make a request to that URL. This will simulate a customer clicking the link directly in their email, and preserves the attribution of the unsubscribe action to the particular experiment, trigger, and campaign involved with the message.

Example client-side get call:

function getQueryVariable(variable) {
const query = window.location.search.substring(1);
const vars = query.split('&');
for (let i = 0; i < vars.length; i++) {
const pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) == variable) {
return decodeURIComponent(pair[1]);
}
}
}
const unsubscribeLink = getQueryVariable('bsft_unsub')
fetch(unsubscribeLink, { mode: 'no-cors'})
.then((response) => console.log(response))

 

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.