In some cases you might not want to use the SubscriberKey as the identifier. This could be because you are using an email address as the SubscriberKey. To avoid security issues, you can also use a different identifier to link interactions to the contact model. This can be done via a mapping table. Follow the steps below to create such a mapping table.
In the example below we are using the SubscriberID instead of the SubscriberKey. You can use any identifier as long as you can map the SubscriberKey with that identifier. For example a userId, externalId, GAID or hashed email address.
Step 1: create a new data extension
- Create a new data extension and call it ‘mapping table’
- Create two fields:
- subscriberkey: text (254), primary key
- subscriberid: text (50), nullable

Step 2: create a SQL activity
- Navigate to Journey Builder >> Automation Studio >> Activities
- Create a new SQL activity
- Call it ‘Mapping Table’
- Use the code below (remove ent. when using this SQL in the Parent)
- Choose update and the data extension we created earlier
- Run the SQL activity and create an automation
SELECT
s.SubscriberID as subscriberid
,s.SubscriberKey as subscriberkey
FROM ent._Subscribers s
Step 3: include mapping in Data Designer
- Navigate to Contact Builder >> Data Designer
- Create a new Attribute Group or select the Attribute Group where the Interactions have been connected
- Connect the mapping data extension on the Contact Key = subscriberkey (one-to-one)
- Connect the AS_InteractionsData and AS_InteractionsVariables as described in this article

Step 4: use the subscriberId in the tags
Below an example of a tag. Change subscriberKey with SubscriberID (or how this is stored in GTM (or in the dataLayer)
<script>
// The unique identifier of a user in Marketing Cloud
var subscriberKey = "{subscriberId}"
// The id of this interaction
var tagId = "xxxx"
// Your endpoint to send the interactions to
var endpoint = "https://xxxx.activation-studio.com/public/api/interactions"
// -----------------------------
// Example code how to send an interaction via a GET request
function marketingCloudInteraction(subscriberKey, variables, types) {
var encodedVars = btoa(JSON.stringify(variables));
var encodedTypes = btoa(JSON.stringify(types));
fetch("https://xxxx.activation-studio.com/public/api/interactions?tagId=xxxx"
.concat('&subscriberKey=' + subscriberKey + '&variables=' + encodedVars + '&types=' + encodedTypes))
}
// This will trigger the send request to Marketing Cloud
marketingCloudInteraction(subscriberKey, {
url: {{Your value for url}},
pagetitle: {{Your value for pagetitle}}
}, {
url: "ValueText",
pagetitle: "ValueText"
})
</script>