Send your event data from RudderStack to Spotify Pixel.
8 minute read
Spotify Pixel is a powerful ad tracking and analytics tool. It is a piece of JavaScript code that you can integrate in your website and analyze the actions the users take after hearing your ads.
Setup
In your RudderStack dashboard, go to Directory > Destinations > Cloud Destinations and search for Spotify Pixel.
Connect your source and click Continue.
Connection settings
Configure the following settings to set up Spotify Pixel as a destination in RudderStack:
Name: Assign a name to uniquely identify the destination.
Pixel ID: Enter your Spotify Pixel ID. To obtain this ID, log in to your Spotify Pixel dashboard and go to Manage > Your Pixels.
After completing the initial setup, configure the following settings to correctly receive your data in Spotify Pixel:
Spotify Pixel Alias Event Setting: Turn on this setting to enhance attribution by passing a Spotify Pixel alias event along with every conversion event.
Client-side Events Filtering: This setting lets you specify which events should be blocked or allowed to flow through to Spotify Pixel. For more information on this setting, see Client-side Events Filtering.
RudderStack to Spotify Pixel Event Mappings: Use this setting to map your RudderStack events to the standard Spotify Pixel events. You can map multiple Spotify Pixel events to a single RudderStack event and vice versa.
Track
You can use the RudderStack track event to track user events along with any associated properties and send this information to Spotify Pixel.
The following table lists the mapping between the optional RudderStack event properties and the Spotify Pixel attributes:
RudderStack property
Spotify Pixel property
properties.price
value
properties.currency
currency
properties.product_id
product_id
properties.name
product_name
properties.product_type
product_type
properties.brand
product_vendor
Sending multiple product details
If you send the product details as an array in the track event, RudderStack fetches the details from each product item and calls the Spotify Pixel product event for each item. For example, consider the following track event:
A sample track call mapped to the Spotify Pixel addtocart event is shown below:
rudderanalytics.track("Add to Cart",{price:23.2,currency:"USD",product_id:"1234000",name:"goldenTest",product_type:"Card",brand:"testVendor",});
The following table lists the mapping between the optional RudderStack event properties and the Spotify Pixel attributes:
RudderStack property
Spotify Pixel property
properties.price
value
properties.currency
currency
properties.product_id
product_id
properties.name
product_name
properties.product_type
product_type
properties.brand
product_vendor
properties.quantity
quantity
properties.variant_id
variant_id
properties.variant_name
variant_name
Similar to the Product event, if you send the product details as an array in the track event, RudderStack fetches the details from each product item and calls the Spotify Pixel addtocart event for each item.
Check out
A sample track call mapped to a Spotify Pixel checkout event is shown below:
The following table lists the mapping between the optional RudderStack event properties and the Spotify Pixel attributes:
RudderStack property
Spotify Pixel property
properties.price
value
properties.currency
currency
properties.quantity
quantity
properties.variant_id
variant_id
properties.discount_code
discount_code
properties.line_items
line_items
If you do not pass the line_items object, then RudderStack fetches the line_items from the event’s properties and maps them to Spotify Pixel’s line_items field.
Passing multiple product items
If you pass multiple product items as an array, then RudderStack fetches the individual product details and internally builds the line_items object before passing it on to Spotify Pixel via the checkout event, as demonstrated in the following example:
The following table lists the mapping between the optional RudderStack event properties and the Spotify Pixel attributes:
RudderStack property
Spotify Pixel property
properties.total properties.revenue
value
properties.currency
currency
properties.discount_code
discount_code
properties.line_items
line_items
properties.order_id
order_id
properties.is_new_customer
is_new_customer
properties.quantity
quantity
Similar to the Check out event, if you pass multiple product items as an array, then RudderStack fetches the individual product details and internally builds the line_items object before passing it on to Spotify Pixel via the purchase event.
Passing hashed internal ID to Spotify Pixel
If you turn on Spotify Pixel Alias Event Setting in the RudderStack dashboard and Alias events are configured for your Spotify Pixel, then RudderStack triggers a Spotify Pixel alias event capturing the hashed internal user ID along with every conversion event.
Note that:
The Spotify Pixel alias event matches the Spotify Pixel internal cookie ID with your hashed internal user IDs.
RudderStack uses SHA-256 encryption for hashing your userId.
To enable this feature, follow these steps:
Activate Alias Events for Spotify Pixel from your dashboard:
Enable the Spotify Pixel Alias Event Setting setting in the RudderStack dashboard.
RudderStack automatically calls the Spotify Pixel alias event by mapping the following internal RudderStack IDs to Spotify Pixel:
RudderStack attribute
Spotify Pixel attribute
userId context.traits.userId context.traits.id
id
Suppose you send the following track call named testEvent (mapped to Spotify Pixel’s lead event) with the Pass Internal ID enabled:
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.