Snapchat Conversion Cloud Mode Integration

Send events to Snapchat’s Conversion API using RudderStack cloud mode.

After you have successfully instrumented Snapchat Conversion as a destination in RudderStack, follow this guide to correctly send your events to Snapchat in cloud mode by leveraging their Conversions API.

You must generate the events at least 28 days before for them to be eligible for reporting via the Conversions API.

Find the open source transformer code for this destination in the GitHub repository.

Track

You can use the track event to capture user actions along with their associated properties and send this information to Snapchat.

Note that:

  • RudderStack tracks and sends the web, mobile, and offline events to Snapchat via their v3 endpoint (https://tr.snapchat.com/v3/{ID}/events), where {ID} is the Advertiser ID associated with your Snapchat business account.
  • It uses Bearer authentication leveraging the Snap API token for authenticating all requests. OAuth is not supported currently.

A sample track call is shown below:

javascript
rudderanalytics.track("Order Completed", {
  order_id: "1234",
  currency: "USD",
  products: [{
      product_id: "345676543",
      price: 7.99
    },
  ],
}, {
  context: {
    traits: {
      email: "alex@example.com",
      phone: "+1-202-555-0146"

    }
  }
})

RudderStack recommends passing at least one of the following fields to send a track event to Snapchat successfully:

  • email
  • phone
  • idfa
  • ip and userAgent

You can also send the eventConversionType property in your track events to determine the type of event to send to Snapchat (web, mobile, or offline).

Snapchat event typeeventConversionType property value
WEBweb
MOBILE_APPmobile / mobile_app
OFFLINEoffline
Make sure to specify the exact property values.

If eventConversionType is not found in the event, RudderStack checks if channel is present. If channel is absent too, RudderStack automatically sets eventConversionType to OFFLINE.

An example highlighting the use of eventConversionType is shown:

javascript
rudderanalytics.track("Products Searched", {
query: "HDMI cable",
eventConversionType: "mobile"
});

Event mappings

This destination does not strictly adhere to the RudderStack Ecommerce Event Spec.

RudderStack automatically maps the following ecommerce events to the corresponding Snapchat Conversion events:

RudderStack eventSnapchat Conversion event
Products SearchedSEARCH
Product List ViewedVIEW_CONTENT
Promotion ViewedAD_VIEW
Promotion ClickedAD_CLICK
Product ViewedVIEW_CONTENT
Product AddedADD_CART
Checkout StartedSTART_CHECKOUT
Payment Info EnteredADD_BILLING
Order CompletedPURCHASE
Product Added to WishlistADD_TO_WISHLIST

RudderStack does not automatically map the following events and passes their properties as is, without any modification:

  • ACHIEVEMENT_UNLOCKED
  • APP_INSTALL
  • APP_OPEN
  • COMPLETE_TUTORIAL
  • INVITE
  • LIST_VIEW
  • LEVEL_COMPLETE
  • LOGIN
  • PAGE_VIEW
  • RATE
  • RESERVE
  • SAVE
  • SIGN_UP
  • SHARE
  • SPENT_CREDITS
  • START_TRIAL
  • SUBSCRIBE

Property mappings

RudderStack propertySnapchat Conversion property
properties.brands
Array
custom_data.brands
properties.click_iduser_data.sc_click_id
properties.uuid_c1user_data.sc_cookie1
properties.att_statusapp_data.advertiser_tracking_enabled
properties.idfv
context.device.id
user_data.idfv
properties.adId
context.device.advertisingId
user_data.madid
properties.item_idscustom_data.content_ids
properties.categorycustom_data.content_category
properties.number_items
properties.quantity
custom_data.num_items
properties.price
properties.value
properties.revenue
(properties.products.price * properties.products.quantity)
custom_data.value
properties.currencycustom_data.currency
properties.search_stringcustom_data.search_string
properties.client_dedup_id
properties.transaction_id
properties.transactionId
event_id
properties.eventConversionTypeaction_source
properties.products.$.product_id
properties.products.$.sku
properties.products.$.id
custom_data.contents.$.id
properties.products.$.pricecustom_data.contents.$.Item_price
properties.products.$.quantitycustom_data.contents.$.quantity
properties.products.$.delivery_categorycustom_data.contents.$.delivery_category
properties.products.$.brandcustom_data.contents.$.brand
properties.$.product_id
properties.$.sku
properties.$.id
custom_data.contents.$.id
properties.$.pricecustom_data.contents.$.Item_price
properties.$.quantitycustom_data.contents.$.quantity
properties.$.delivery_categorycustom_data.contents.$.delivery_category
context.ip
request_ip
user_data.client_ip_address
context.userAgentuser_data.client_user_agent
context.page.url
properties.url
event_source_url
traits.firstName
traits.firstname
traits.first_name
context.traits.firstName
context.traits.firstname
context.traits.first_name
Transformed and sent as hashed value by RudderStack.
user_data.fn
traits.lastName
traits.lastname
traits.last_name
context.traits.lastName
context.traits.lastname
context.traits.last_name
Transformed and sent as hashed value by RudderStack.
user_data.ln
traits.address.city
context.traits.address.city
Transformed and sent as hashed value by RudderStack.
user_data.ct
traits.email
context.traits.email
properties.email
Transformed and sent as hashed value by RudderStack.
user_data.em
traits.phone
context.traits.phone
properties.phone
Transformed and sent as hashed value by RudderStack.
user_data.ph
traits.gender
context.traits.gender
Transformed and sent as hashed value by RudderStack.
user_data.ge
traits.state
context.traits.state
Transformed and sent as hashed value by RudderStack.
user_data.st
traits.country
context.traits.country
Transformed and sent as hashed value by RudderStack.
user_data.country

extinfo mapping

This section lists the mappings for the extinfo object.

RudderStack property
extinfo index
context.device.type0

RudderStack automatically sets the value to i2 for Apple or a2 for Android, depending on the source.
context.app.namespace1
context.app.build2
context.app.version3
context.device.model4
context.locale5
moment().tz(context.timezone)?.format('z');6

See Moment Timezone documentation for more information. RudderStack uses this package to get the timezone abbreviation string.
context.network.carrier7
context.screen.width8
context.screen.height9
context.screen.density10
properties.cpu_cores11
properties.storage12
properties.free_storage13
context.timezone14
If a value for any of the above properties is missing in the event, then RudderStack sets the corresponding extinfo index to an empty string.

Page

You can use the page call to record your website’s page views, with any additional relevant information about the viewed page.

RudderStack processes page calls as track calls with the Snapchat event set to page_view.

Hence, all the required fields for track events are required here as well.

A sample page call sent to Snapchat is shown below:

javascript
rudderanalytics.page("Help", "Help Page", {
  name: "Contact Customer Care",
  request_ip: "203.0.113.0",
  context: {
    userAgent: "ABC"
  }
})

Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.