# SalesForce Marketing Cloud (Pull)

## SalesForce Marketing Cloud (Pull)

<div align="left"><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-79ac5e71e70b6f8ea1c56582ad0db78bd4175e55%2Fe2819056ca26bfaff017e84d1393d295.png?alt=media" alt="" width="110"></div>

This guide outlines the steps to integrate AB Tasty with Salesforce Marketing Cloud (SFMC) and pull audience data into AB Tasty from a designated Data Extension (DE) in SFMC.

## Overview <a href="#h_01jjrtb2vydwm49xsxnwjwbwjq" id="h_01jjrtb2vydwm49xsxnwjwbwjq"></a>

Salesforce Marketing Cloud (SFMC) is a digital marketing platform that supports multichannel campaigns, including email, social media, and advertising. By integrating SFMC with AB Tasty you can leverage SFMC-created segments to personalise your website campaigns.

The SFMC Pull integration enables AB Tasty to retrieve audience data from a dedicated Data Extension in SFMC, allowing for targeted experiences on your website.

### Integration <a href="#h_01jjrtb2vy7349r6agyw32hwzw" id="h_01jjrtb2vy7349r6agyw32hwzw"></a>

#### Definition and Process <a href="#h_01jjrtb2vy101z93se4k1t5t4k" id="h_01jjrtb2vy101z93se4k1t5t4k"></a>

The SFMC Pull integration establishes a connection between your SFMC Data Extension and AB Tasty, enabling AB Tasty to retrieve audience data for website personalisation. <br>

#### Requirements <a href="#h_01jjrtb2vys2wavywwfkbgpn8n" id="h_01jjrtb2vys2wavywwfkbgpn8n"></a>

**Visitor Identification**

Since SFMC lacks native visitor identification for websites, visitors must be uniquely identified using one of the following methods:\
\
**2 Methods which imply a modification on your side by creating either a cookie or adding a key to your Local Storage**

1. **Local Storage:** Store the visitor ID under the SFMC\_VISITOR\_ID key.
2. **Cookie:** Store the visitor ID under the SFMC\_VISITOR\_ID key.

**A third method can be used and added within the Account JS of your AB Tasty Account**

**AB Tasty Method:** Use a window\.ABTasty.setSFMCVisitorId to assign the ID.

**Data Extension Setup**

**The dedicated Data Extension (DE) should be created and made available to AB Tasty.**\
**AB Tasty will retrieve data from this DE daily.**\
\
\
**Below is the required structure for the DE:**

| **Field Name**    | **Type** | **Details**                                                                                                    |
| ----------------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| **SubscriberKey** | String   | The subscriber key associated with one or more audiences (Primary Key).                                        |
| **Audience**      | String   | The name of the audience linked to the subscriber key.                                                         |
| **Value**         | Optional | The audience-specific value (if applicable).                                                                   |
| **Date**          | String   | Current date in MM/DD/YYYY format (Primary Key).                                                               |
| **is\_include**   | Boolean  | The default is TRUE. Set to FALSE if a visitor has been removed from an audience after being included earlier. |

**Example Records**

| **ID** | **SubscriberKey** | **Audience** | **Value** | **Date**   | **is\_include** |
| ------ | ----------------- | ------------ | --------- | ---------- | --------------- |
| 1      | idVisitorId1      | audience 1   | value 1   | 12/25/2024 | TRUE            |
| 2      | idVisitorId2      | audience 1   | value 2   | 12/25/2024 | TRUE            |
| 3      | idVisitorId2      | audience 2   |           | 12/26/2024 | TRUE            |
| 4      | idVisitorId3      | audience 3   |           | 12/26/2024 | FALSE           |
| 5      | idVisitorId2      | audience 2   |           | 12/26/2024 | FALSE           |

**The records must be structured as follows:**

* ***SubscriberKey*****,&#x20;*****Audience*****&#x20;and&#x20;*****date*****&#x20;must be inserted inside the keys field (of the data extension**
* ***Value*****&#x20;and&#x20;*****is\_include*****&#x20;must be included inside the values field (of the data extension)**

**Here is an example of the correct structure of a dedicated Data Extension for AB tasty**\ <br>

<figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-6cfa58185b95bf8f142484d5cb18a3cfe31791a5%2F65e53d68c69c90008bcd21add9af7ae3.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

#### **How to Set Up the Integration** <a href="#h_01jjrtb2vy7m1z4zs2axm31a0f" id="h_01jjrtb2vy7m1z4zs2axm31a0f"></a>

**Step 1: Configure the Connector in AB Tasty**

1. Log in to your AB Tasty account.
2. Go to **Integrations** > **Integration Hub**.
3. Search for and select **Salesforce Marketing Cloud (Pull section)**.<br>

   <figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-538c55701387dbaa98bd055b1e79290944d52879%2F124303625f8415096705a393f3609107.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>
4. Click **Setup Connector** and provide the following details:\
   \
   **Connector Name:** A unique name to identify the connector.\
   **Client ID:** Your SFMC clientId.\
   **Client Secret:** Your SFMC clientSecret.\
   **Account ID:** Your SFMC account ID (sometimes called Merchant ID).\
   **Subdomain:** Your SFMC subdomain.\
   **Data Extension ID:** The ID of the Data Extension created in Step 1\
   **Visitor ID Location:** The method used to store the SFMC\_VISITOR\_ID (e.g., Local Storage, Cookie, or AB Tasty Method).<br>

   <figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-1050cf97c8f0448be2a38cbb4cc57e9f758b06b6%2F02f7c4ee9c7ae42060f26247de2b62f9.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>
5. **Create** the connector

**Step 2: Verify the Integration (usually at J+1)**

1. Ensure that your website includes the AB Tasty tag.
2. Test the visitor identification process (e.g., through login or form submission).
3. Based on your choice preference / Cookie - Local Storage - AB tasty method\
   \
   Verify that AB Tasty is retrieving audience data from the specified DE.\
   \
   Go to your website and enable debug mode by running the following command in the browser console:

document.cookie="abTastyDebug=true;path=/;";

Refresh your browser and act to become a registered visitor (like login or form submission).\
If you fall in the right Audience criterion\
you'll see a matching VisitorID&#x20;

<figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-8c76a39fcd8de2abe17d0b8a391087d545f81b1b%2Fbc23af54f82e8aa521254babbd48a7b7.png?alt=media" alt="" width="539"><figcaption></figcaption></figure>

And a success linked to SFMC ( if the table appears empty, it's simply because our bridge retrieve audience one time per day)

![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-1b3e6279968ada21f8e3096c1bd8ca7afa5265bd%2F97eca483da8e51569920291191c9876c.png?alt=media)

4\. Then the Audience should be available from AB Tasty Segment builder\
under **External Data>SFMC**

<figure><img src="https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-477f7899a3e2b2c8d622df5eda29d76fd71ac1c5%2F0ff8fa0c89a4a14c47cc193cf4c1d912.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}

#### **Good to Know** <a href="#h_01jjrtb2vy14zfae61nzppqrdf" id="h_01jjrtb2vy14zfae61nzppqrdf"></a>

* **Mandatory Fields**: All fields are **required**.\
  The clientId, clientSecret, accountId, subDomain, and DataExtension ID fields are required to authenticate the integration and enable data push. SFMC\_VISITOR\_ID will allow AB Tasty to identify your visitors during a campaign
* **Data Accuracy**: Ensure your Data Extension includes up-to-date information for reliable audience targeting.
* **Known Visitors Only**: The integration only applies to "known" visitors with a subscriber key
  {% endhint %}

{% hint style="warning" %}

#### **Heads Up ⚡** <a href="#h_01jjrtb2vy3hsjjbaqpjbghfms" id="h_01jjrtb2vy3hsjjbaqpjbghfms"></a>

* **Primary Keys**: Do not modify the SubscriberKey or Date fields in the Data Extension, as they are critical for syncing data.
* **Customisations**: You can filter or arrange the Data Extension data to suit your marketing needs, as long as the required structure is maintained.
* The **SubscriberKeys** in the Data Extension **must** be identical to those you provide via the AB Tasty method (or Local Storage or Cookies) for proper matching. Otherwise, the integration **will fail**.
  {% endhint %}

Following these steps, you’ll successfully integrate AB Tasty with SFMC, enabling personalised audience targeting on your website! 🎉
