The ‘signed-in" integration allows you to measure campaigns across devices and across sites by providing Brand Metrics with a UserId to use as a storage key.
Whenever the userId is present, Brand Metrics can store the campaign exposure and survey answer data on our servers instead of in the user’s browser.
You can also add you own metadata to what is being stored, e.g. to leverage your own first-party data.
The userId can also be a subscriptionId, pageViewId or a persistent ID of your chosing.
The UserId can be provided in two ways, either by configuring a script on the website, or by calling the Brand Metrics single-user API endpoint.
If you can provide a javascript callback function to read the user ID from e.g. a DOM object, cookie or local storage, then we simply add this to your on-page script configuration to run automatically on each page load.
{
listeners: [...],
storage: "...",
userMode: {
type:"custom",
conf: {
script:"callback('user-id')"
}
}
}
Alternatively, you can place the id-reading javascript on the web page and call the Brand Metrics API to pass the user ID to the on-page script, e.g.
<script>
window._brandmetrics = window._brandmetrics || [];
window._brandmetrics.push(
{
cmd:"_adduserids",
val:['user-id']
}
);
</script>
Each UserId provided as a parameter is combined with your internal Customer GUID to create an internal BrandmetricsId. The UserId and BrandmetricsId are stored in a mapping table in Azure Table Storage.
Exposures are aggregated just as they are without any UserId but the full exposure data is also now stored with the corresponding BrandmetricsId, enabling us to retrieve data for all exposures for a given id.
The server-side storage enables us to store additional information with each exposure. This is done using the brandmetrics javascript API function _addmetadata
The types- array may be used to filter whether the metadata will be added to the “ANSWER” or “EXPOSURE” object. It defaults to [“ANSWER”] to be backwards compatible with the current _addmetadata- function.
<script>
window._brandmetrics = window._brandmetrics || [];
window._brandmetrics.push(
{
cmd:"_addmetadata",
val:{
name: "sum_metadata_key",
value: "sum_metadata_value",
types: ["EXPOSURE"] // "EXPOSURE" | "ANSWER"
}
}
);
</script>