SalesForce Marketing Cloud (Pull)

SalesForce Marketing Cloud & AB Tasty

Salesforce Marketing Cloud is a digital marketing platform that helps businesses manage multichannel campaigns, including email, social media, and advertising. It enables personalized customer interactions through data integration and automation, allowing companies to optimize their marketing strategies and improve overall performance.

The SFMC integration allows you to target the segments created in SFMC with AB Tasty

Integration

Definition and process

Here a graph showing how the SFMC Pull integration is working: 

  1. A visitor arrives on your website. 
  2. Once this visitor is identified (thanks to a login page - form - newsletter, etc ..), we are able to link the visitor with the SFCC subscriber key.
  3. Segments are stored in another dedicated Data Extension (called Segment DE). 
  4. AB tasty retrieves these segments once a day and stores them into one temporary database.
  5. As soon as the same visitor comes back on the website, AB Tasty can identify this visitor and check if this visitor is included in one segment (or not). If yes, AB Tasty sends the segment to the segment builder.
  6. You can create a new AB tasty campaign with your own SFMC segment.

Steps 2, 4, 5, 6 are handled by AB Tasty. However, step 3 (generating segment) is managed by your SFMC service. You have to build the segments on your side with your own SQL request (or script), because we don’t have the knowledge on your SFMC database. 

Requirements 

Global information

Because SFMC is a marketing tool, there is no native way to identify one SFMC visitorId on your own website. 

This is the reason why this integration between AB Tasty and SFMC works under the following conditions: 

  • A visitorId must be identified (thanks to a login, a form, a newsletter, etc ..). We’re not able to send our AB Tasty event if an anonymous visitorId is on your website.
  • Early Adoption Requirement: You have to provide AB Tasty Team a functional/technical way to identify & retrieve a visitorID (Data Layer, local storage, cookies, custom code).
    This visitor ID is equal to the SFMC subscriber key.

Implementation SFMC with SFCC on your website

This section aims at providing guidance on how to install and configure the AB Tasty ↔︎ Salesforce Marketing Cloud connector on your website. This guide does not contain any installation/setup steps regarding AB Tasty itself, nor Salesforce Marketing Cloud itself.

Purpose

The purpose of this connector is to provide a bridge between your website and the AB Tasty JavaScript snippet so that the AB Tasty snippet gets the customer’s subscriber key when the user is navigating the website. This only works for “known" users, meaning people that exist in Salesforce Marketing Cloud and have been assigned a subscriber key.

Identify the correct installation section

Before jumping into the installation, you need to identify what is your actual architecture when it comes to how your website is integrated (or not) with Salesforce Marketing Cloud. Here is a simple chart to help you go to the right section of this article:

Installation guides

#1 You are not using Salesforce B2C Commerce Cloud to host your website

In case you are not using Salesforce B2C Commerce Cloud to host your website, you’ll have to implement two parts of the connector’s behavior to make it work:

  1. Integrate the JavaScript file into your website (either in the <head> tag or at the end of the <body> tag)
  2. Make sure to provide the customer’s subscriber key used in Salesforce Marketing Cloud within a <meta> tag with the name sfmc_subscriberKey. Here is an example: <meta name="sfmc_subscriberKey" content="subscriberKeyValueForTheCustomer" /> in the <head> tag. This should be done on all pages, or at least all the pages where AB Tasty is included on your website

#2 You are using Salesforce B2C Commerce Cloud to host your website

#2.1 You are using Salesforce Service Cloud, Salesforce Marketing Cloud and Salesforce B2C Commerce Cloud, and are following the solution kit to integrate them all

In case you are using Salesforce Service Cloud, and integrated all three clouds by following the Salesforce solution kit, this means you are using b2c-crm-sync to resolve customer profiles between Salesforce Service Cloud and Salesforce B2C Commerce Cloud. The principle of the solution kit is that you should use the Salesforce Service Cloud Contact ID as a subscriber key when sending customer profiles from Salesforce B2C Commerce Cloud to Salesforce Marketing Cloud. Thus, the subscriber key used in Salesforce Marketing Cloud is already known in Salesforce B2C Commerce Cloud, stored within the b2ccrm_contactId custom attribute of the profile.

#2.1.1 You are using SFRA

If all of this is the case, and you are using SFRA, then you can:

  1.  Download the plugin_abtasty_sfmc_connector
  2.  Upload it to your Salesforce B2C Commerce Cloud instance
  3. Add it to your cartridge path

The connector will automatically plug in a hook from the SFRA template to inject the <meta> tag and the Javascript file for authenticated customers in the <head> tag.

#2.1.2 You are not using SFRA

If all of this is the case, but you are not using SFRA, then you must:

  1. Integrate the Javascript file into the website (either in the <head> tag or at the end of the <body> tag). You can either store the file into one of your cartridge, or within the library of the site.
  2. Make sure to provide the customer’s subscriber key saved in the customer profile b2ccrm_contactId custom attribute within a <meta> tag with the name sfmc_subscriberKey. Here is an example: <meta name="sfmc_subscriberKey" content="subscriberKeyValueForTheCustomer" /> in the <head> tag. This should be done on all pages, or at least all the pages where AB Tasty is included on your website.

#2.2 You are not using Salesforce Service Cloud, or not following the solution kit to integrate SFSC, SFMC and SFCC

#2.2.1 You are already saving the Salesforce Marketing Cloud subscriberKey onto the Salesforce B2C Commerce customer profile

In case you are not following the solution kit, but the Salesforce Marketing Cloud subscriber key is stored on the Salesforce B2C Commerce customer profile, then please follow these steps.

#2.2.1.1 You are using SFRA

If you are using SFRA, then you can leverage the plugin_abtasty_sfmc_connector cartridge, and need to overwrite the configuration file. Please follow these steps:

  1. Download the plugin_abtasty_sfmc_connector
  2. Upload it to your Salesforce B2C Commerce Cloud instance
  3. Add it to your cartridge path
  4. In a cartridge that you manage, please create the file cartridge/scripts/abtasty_sfmc_connector/config.json, which will overwrite the one from the connector, and modify it as follows:
{
  "profileAttribute": "custom.attributeWhereSubscriberKeyIsSaved"
}

Note that you can provide both standard and custom attributes to this configuration, and the code will automatically try to load the value from a custom attribute if you provide “custom." or from a standard attribute if you don’t.

The rest of the plugin cartridge doesn’t need any extra change.

#2.2.1.2 You are not using SFRA

If you are not using SFRA, then you’ll have to implement the two components of the connector yourself by following these steps:

  1. Integrate the JavaScript file into the website (either in the <head> tag or at the end of the <body> tag). You can either store the file in one of your cartridge or within the library of the site.
  2. Make sure to provide the customer’s subscriber key saved in the customer profile within a <meta> tag with the name sfmc_subscriberKey. Here is an example: <meta name="sfmc_subscriberKey" content="subscriberKeyValueForTheCustomer" /> in the <head> tag. This should be done on all pages, or at least all the pages where AB Tasty is included on your website.

#2.2.2 You are not yet saving the Salesforce Marketing Cloud subscriberKey onto the Salesforce B2C Commerce customer profile

In case you are not yet saving the Salesforce Marketing Cloud subscriberKey onto the Salesforce B2C Commerce customer profile, then you’ll need to implement this integration yourself. Once done, and so the subscriberKey is saved on the customer profile in Salesforce B2C Commerce, you can refer to section #2.2.1. Please note that the connector’s cartridge is looking for the subscriberKey in the profile’s b2ccrm_contactId custom attribute as this attribute is defined by b2c-crm-sync, recommended in the Salesforce solution kit. If you save it here, then the connector will work right away, if not, then you’ll need to follow step 4 from section #2.2.1.1 to override the configuration of the connector.

Definition of Segment Data Extension (step 3)

This Data Extension should be available for the AB Tasty teams. The objective is that the AB Tasty Team can retrieve the data available on this table every day. Here is the structure of the DE. 

You should have the following fields : 

  • SubscriberKey (text) // The subscriberKey linked to one (several) audience(s) (as Primary Key)
  • Audience (text) // The name of the audience linked to the subscriber key
  • Value: If the audience has a value (optional)
  • Date:  Current Date (as Primary Key) as Text (MM/DD/YYYY)
  • is_include: Boolean (by default true). Set it at false if one visitor was included in one audience, and since this same visitor is now excluded from this audience. If it is the case, set it to false.

You must reproduce this structure on your website to have one dedicated DE where AB Tasty can retrieve this raw. You must provide us with the ID of this DE (see later).
Example records:

Id subscriberKey audience value date is_include
1 idVisitorId1 audience 1 value 1 09/07/24 TRUE
2 idVisitorId2 audience 1 value 2 09/07/24 TRUE
3 idVisitorId2 audience 2   09/07/24 TRUE
4 idVisitorId3 audience 3   09/07/24 FALSE
5 idVisitorId2 audience 2   09/07/24 FALSE

AB Tasty Configuration 

  1. Go to the Integration Hub page.
  2. Search for and select Salesforce Marketing Cloud (Pull section).

  1. Click Setup connector.
  2. Give a name to your connector so you can easily retrieve it.
  3. Enter all the mandatory fields 
  • clientId: refers to the SFMC clientId 
  • clientSecret: refers to your SFMC clientSecret 
  • accountId: refers to your SFMC accountId (called Merchant ID too) 
  • subDomain SFMC: refers to your SFMC subdomain 
  • Data Extension Target: You must provide the id of the Segment DE

The fields : clientId, clientSecret, accountId, subDomain are mandatory in order to establish one token (see this documentation). The field Data Extension Target is present only to determine on which DE we can retrieve all segments with the subscriberKey (see this documentation).

Was this article helpful?

/