1. Ad Analytics Help Center
  2. Getting Started
  3. 3. Install the Spotify Pixel or RSS Prefix

How does the Alias ID Event Work?

Below you will learn how to understand and install the alias ID event.

Applies to: Brands and Agencies

The Alias ID event is an optional advanced Ad Analytics event designed to assist by providing more context around your data. This event does require advanced knowledge about your systems.

By default, Spotify Ad Analytics only provides data in an aggregated, anonymized format. An Alias event can be used to match Spotify Ad Analytics' internal cookie ID with your own hashed internal user IDs. This will allow you to match back the conversions we attribute with your internal systems. 

To turn on your Alias ID event, head to your Manage tab > Your Pixels > click on the "+" sign under Alias > toggle on and input your hashed internal user ID > click Save Pixel.

Once you turn it on, your Verified Event scripts will update to include the Alias ID code. If you are editing your already placed script, the general placement for the Alias ID event is after the line with your Pixel Key ID and before the line where the conversion event is stated. See the example script below. 

// Installation script generated by Ad Analytics
(function(w, d){
var id='spdt-capture', n='script';
if (!d.getElementById(id)) {
w.spdt =
w.spdt ||
function() {
(w.spdt.q = w.spdt.q || []).push(arguments);
var e = d.createElement(n); e.id = id; e.async=1;
e.src = 'https://pixel.byspotify.com/ping.min.js';
var s = d.getElementsByTagName(n)[0];
s.parentNode.insertBefore(e, s);
w.spdt('conf', { key: '5a1c965e567a45f7832cc5ba7a37faf7' });
// Dynamically populate alias from session data
w.spdt('alias', { id: 'testing' });
w.spdt('purchase', {
order_id: '', // Dynamically populate from session data
discount_code: '', // Dynamically populate from session data
is_new_customer: '', // Dynamically populate from session data
value: '', // Dynamically populate from session data
currency: '',
})(window, document);


If you are not using the platform generated scripts (Verified Events Table), include your hashed internal ID within the "id" field within the alias event script and Spotify Ad Analytics will send encrypted data.

spdt('alias', {
id: 'hashed internal ID',});