Skip to main content

Snap Pixel

Snap Pixel provides an entity that advertisers can use to build a correlation between the ads that the users viewed and the conversions that happened on advertiser's website.

Create a Pixel

You can create a Snap Pixel for your Ad Account on Ad Manager

Get the Pixel associated with an Ad Account

curl "https://adsapi.snapchat.com/v1/adaccounts/{ad_account_id}/pixels" \
-H "Authorization: Bearer meowmeowmeow"

The above command returns JSON structured like this:

{
"request_status": "SUCCESS",
"request_id": "5a0253c100ff013af0e5dd11d40001737e616473617069736300016275696c642d61306563656639392d312d3131392d3300010124",
"pixels": [
{
"sub_request_status": "SUCCESS",
"pixel": {
"id": "6abc82ca-4a3a-4391-98ba-0317a8471234",
"updated_at": "2017-03-15T18:19:08.576Z",
"created_at": "2017-03-15T18:19:08.576Z",
"effective_status": "ACTIVE",
"name": "Test pixel",
"ad_account_id": "3cb7c65d-a943-448b-90aa-bd6bac71dabc",
"status": "ACTIVE",
"pixel_javascript": "<!-- Snap Pixel Code -->\n<script type='text/javascript'>\n(function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()\n{a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};\na.queue=[];var s='script';r=t.createElement(s);r.async=!0;\nr.src=n;var u=t.getElementsByTagName(s)[0];\nu.parentNode.insertBefore(r,u);})(window,document,\n'https://sc-static.net/scevent.min.js');\n\nsnaptr('init', '6abc82ca-4a3a-4391-98ba-0317a8471234', {\n'user_email': '__INSERT_USER_EMAIL__'\n});\n\nsnaptr('track', 'PAGE_VIEW');\n\n</script>\n<!-- End Snap Pixel Code -->"
}
}
]
}

This endpoint retrieves the pixel associated with the specified Ad Account.

HTTP Request

GET https://adsapi.snapchat.com/v1/adaccounts/{ad_account_id}/pixels

Parameters

ParameterDefaultDescription
ad_account_idAd Account ID

Implementing the Snap Pixel

Please check Business Help Center for steps to implement the pixel on your website.

Get a Specific Pixel

curl "https://adsapi.snapchat.com/v1/pixels/sf6f3815-3527-49e3-a5a7-b9681b31daf4" \
-H "Authorization: Bearer meowmeowmeow"

The above command returns JSON structured like this:

{
"request_status": "SUCCESS",
"request_id": "5a025dac00ff011af30b6a01d00001737e616473617069736300016275696c642d61306563656639392d312d3131392d3300010162",
"pixels": [
{
"sub_request_status": "SUCCESS",
"pixel": {
"id": "sf6f3815-3527-49e3-a5a7-b9681b31daf4",
"updated_at": "2017-03-15T18:19:08.576Z",
"created_at": "2017-03-15T18:19:08.576Z",
"effective_status": "ACTIVE",
"name": "Test pixel",
"ad_account_id": "3c42c65d-a943-448b-90aa-bd6bac71d2bc",
"status": "ACTIVE",
"pixel_javascript": "<!-- Snap Pixel Code -->\n<script type='text/javascript'>\n(function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()\n{a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};\na.queue=[];var s='script';r=t.createElement(s);r.async=!0;\nr.src=n;var u=t.getElementsByTagName(s)[0];\nu.parentNode.insertBefore(r,u);})(window,document,\n'https://sc-static.net/scevent.min.js');\n\nsnaptr('init', 'sf6f3815-3527-49e3-a5a7-b9681b31daf4', {\n'user_email': '__INSERT_USER_EMAIL__'\n});\n\nsnaptr('track', 'PAGE_VIEW');\n\n</script>\n<!-- End Snap Pixel Code -->"
}
}
]
}

This endpoint retrieves a pixel associated with a specific Ad Account.

HTTP Request

GET https://adsapi.snapchat.com/v1/pixels/<PIXEL_ID>

URL Parameters

ParameterDescription
IDThe ID of the Pixel to retrieve

Update a Pixel - Organization level

curl -X PUT \
-H "Authorization: Bearer meowmeowmeow" \
-H "Content-Type: application/json" \
-d '{"pixels":[{"id":"6eda10b7-a5fe-4ac6-80f4-417e68d748fb","name": "New pixel name","organization_id":"7fdeefec-f502-4ca8-9a84-6411e0a51053"}]}'
https://adsapi.snapchat.com/v1/organizations/7fdeefec-f502-4ca8-9a84-6411e0a51053/pixels

The above command returns JSON structured like this:

{
"request_status": "SUCCESS",
"request_id": "589a3df500ff035b6c6fefa6340001737e616473617069736300016275696c642d62666138636139332d312d33392d3400010123",
"pixels": [
{
"sub_request_status": "SUCCESS",
"pixel": {
"id": "6eda10b7-a5fe-4ac6-80f4-417e68d748fb",
"updated_at": "2024-01-30T14:49:40.516Z",
"created_at": "2018-10-15T07:08:15.742Z",
"last_updated_by_app_id": "ff503f30-8e94-450b-abac-18e3e25a8da1",
"last_updated_by_user": "82beca53-2402-45f6-bc0f-1244a2cb8936",
"name": "New pixel name",
"organization_id": "7fdeefec-f502-4ca8-9a84-6411e0a51053",
"status": "ACTIVE",
"pixel_javascript": "<!-- Snap Pixel Code -->\n<script type='text/javascript'>\n(function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()\n{a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};\na.queue=[];var s='script';r=t.createElement(s);r.async=!0;\nr.src=n;var u=t.getElementsByTagName(s)[0];\nu.parentNode.insertBefore(r,u);})(window,document,\n'https://sc-static.net/scevent.min.js');\n\nsnaptr('init', '6eda10b7-a5fe-4ac6-80f4-417e68d748fb', {\n'user_email': '__INSERT_USER_EMAIL__'\n});\n\nsnaptr('track', 'PAGE_VIEW');\n\n</script>\n<!-- End Snap Pixel Code -->",
"visible_to": [
"AdAccountEntity_438cf09a-c829-41f9-bb08-89512a574682",
"AdAccountEntity_3dbf041c-f500-442a-89e3-cfd2311dbdd9",
"OrganizationEntity_7fdeefec-f502-4ca8-9a84-6411e0a51053",
"AdAccountEntity_88225ba6-7559-4000-9663-bace8adff5f2"
]
}
}
]
}

This endpoint retrieves a pixel associated with a specific Organization.

Attributes

AttributeDescriptionRequiredPossible Values
idID of the PixelR
nameName of the PixelR
organization_idOrganization IDR

Attributes that can be updated

AttributeDescription
nameName of the Pixel

HTTP Request

PUT https://adsapi.snapchat.com/v1/organizations/{{organization_id}}/pixels

Parameters

ParameterDefaultDescription
ad_account_idAd Account ID

Update a Pixel - Ad Account level

curl -X PUT \
-H "Authorization: Bearer meowmeowmeow" \
-H "Content-Type: application/json" \
-d '{"pixels":[{"id":"6eda10b7-a5fe-4ac6-80f4-417e68d748fb","name": "New pixel name","ad_account_id":"88225ba6-7559-4000-9663-bace8adff5f2"}]}'
https://adsapi.snapchat.com/v1/adaccounts/88225ba6-7559-4000-9663-bace8adff5f2/pixels

The above command returns JSON structured like this:

{
"request_status": "SUCCESS",
"request_id": "589a3df500ff035b6c6fefa6340001737e616473617069736300016275696c642d62666138636139332d312d33392d3400010123",
"pixels": [
{
"sub_request_status": "SUCCESS",
"pixel": {
"id": "6eda10b7-a5fe-4ac6-80f4-417e68d748fb",
"updated_at": "2024-01-30T14:46:58.636Z",
"created_at": "2018-10-15T07:08:15.742Z",
"last_updated_by_app_id": "ff503f30-8e94-450b-abac-18e3e25a8da1",
"last_updated_by_user": "82beca53-2402-45f6-bc0f-1244a2cb8936",
"name": "New pixel name",
"organization_id": "7fdeefec-f502-4ca8-9a84-6411e0a51053",
"ad_account_id": "88225ba6-7559-4000-9663-bace8adff5f2",
"status": "ACTIVE",
"pixel_javascript": "<!-- Snap Pixel Code -->\n<script type='text/javascript'>\n(function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()\n{a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};\na.queue=[];var s='script';r=t.createElement(s);r.async=!0;\nr.src=n;var u=t.getElementsByTagName(s)[0];\nu.parentNode.insertBefore(r,u);})(window,document,\n'https://sc-static.net/scevent.min.js');\n\nsnaptr('init', '6eda10b7-a5fe-4ac6-80f4-417e68d748fb', {\n'user_email': '__INSERT_USER_EMAIL__'\n});\n\nsnaptr('track', 'PAGE_VIEW');\n\n</script>\n<!-- End Snap Pixel Code -->"
}
}
]
}

This endpoint will update a specified pixel.

Attributes

AttributeDescriptionRequiredPossible Values
idID of the PixelR
nameName of the PixelR
ad_account_idAd Account IDR

Attributes that can be updated

AttributeDescription
nameName of the Pixel

HTTP Request

PUT https://adsapi.snapchat.com/v1/adaccounts/{{ad_account_id}}/pixels

Parameters

ParameterDefaultDescription
ad_account_idAd Account ID

Associate a Pixel to an Ad Squad

To track conversions, the pixel_id parameter must be set in the Ad Squad creation call.

curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer meowmeowmeow" \
-d '{"adsquads": [{"name": "Ad Squad with Pixel", "status": "PAUSED", "campaign_id": "84dc65d7-2745-45c3-a2b7-2d616dbb7fff", "type": "SNAP_ADS", "placement": "SNAP_ADS", "billing_event": "IMPRESSION", "bid_micro": "5000000", "daily_budget_micro": "100000000", "start_time": "2017-03-31T15:00:00.444-07:00", "end_time": "2017-04-30T12:16:17.444-07:00", "optimization_goal": "IMPRESSIONS", "targeting": {"regulated_content": false, "geos": [{"country_code": "us"}]}, "pixel_id": "6c9d82ca-4a3a-4391-98ba-0317a8471233"}]}' \
https://adsapi.snapchat.com/v1/campaigns/6cf25572-048b-4447-95d1-eb48231751be/adsquads

The above command returns JSON structured like this:

{
"request_status": "SUCCESS",
"request_id": "58e8246700ff03be1041ca773d0001737e616473617069736300016275696c642d39663230313762372d312d35362d3300010111",
"adsquads": [
{
"sub_request_status": "SUCCESS",
"adsquad": {
"id": "7fe85cf3-74c7-494e-bdf6-4db478dc4955",
"updated_at": "2017-04-07T23:44:40.447Z",
"created_at": "2017-04-07T23:44:40.447Z",
"name": "Ad Squad with Pixel",
"status": "PAUSED",
"campaign_id": "84dc65d7-2745-45c3-a2b7-2d616dbb7fff",
"type": "SNAP_ADS",
"targeting": {
"regulated_content": false,
"geos": [
{
"country_code": "us"
}
]
},
"placement": "SNAP_ADS",
"billing_event": "IMPRESSION",
"bid_micro": 5000000,
"daily_budget_micro": 100000000,
"start_time": "2017-03-31T22:00:00.444Z",
"end_time": "2017-04-30T19:16:17.444Z",
"optimization_goal": "IMPRESSIONS",
"pixel_id": "6c9d82ca-4a3a-4391-98ba-0317a8471233"
}
}
]
}

Conversion Event Stats

The conversion event metrics available are listed here

Get Campaign Stats

curl "https://adsapi.snapchat.com/v1/campaigns/69d120bd-b319-4201-9a2a-0e64b2ee5411/stats?granularity=DAY&fields=impressions,swipes,conversion_purchases,conversion_save,conversion_start_checkout,conversion_add_cart,conversion_view_content,conversion_add_billing,conversion_sign_ups,conversion_searches,conversion_level_completes,conversion_app_opens,conversion_page_views&start_time=2017-04-28T07:00:00.000-00:00&end_time=2017-04-30T07:00:00.000-00:00" \
-H "Authorization: Bearer meowmeowmeow"

The above command returns JSON structured like this:

{
"request_status": "SUCCESS",
"request_id": "5907c87e00ff00ffebe513c872800001737e616473617069736300016275696c642d62663930383438312d312d36322d3200010112",
"timeseries_stats": [
{
"sub_request_status": "SUCCESS",
"timeseries_stat": {
"id": "69d120bd-b319-4201-9a2a-0e64b2ee5411",
"type": "CAMPAIGN",
"granularity": "DAY",
"start_time": "2017-04-28T00:00:00.000-07:00",
"end_time": "2017-04-30T00:00:00.000-07:00",
"finalized_data_end_time": "2017-05-01T00:00:00.000-07:00",
"timeseries": [
{
"start_time": "2017-04-28T00:00:00.000-07:00",
"end_time": "2017-04-29T00:00:00.000-07:00",
"stats": {
"impressions": 7715,
"swipes": 57,
"conversion_purchases": 200,
"conversion_save": 150,
"conversion_start_checkout": 300,
"conversion_add_cart": 500,
"conversion_view_content": 785,
"conversion_add_billing": 666,
"conversion_sign_ups": 1000,
"conversion_searches": 1500,
"conversion_level_completes": 450,
"conversion_app_opens": 800,
"conversion_page_views": 1500
}
},
{
"start_time": "2017-04-29T00:00:00.000-07:00",
"end_time": "2017-04-30T00:00:00.000-07:00",
"stats": {
"impressions": 7715,
"swipes": 57,
"conversion_purchases": 200,
"conversion_save": 150,
"conversion_start_checkout": 300,
"conversion_add_cart": 500,
"conversion_view_content": 785,
"conversion_add_billing": 666,
"conversion_sign_ups": 1000,
"conversion_searches": 1500,
"conversion_level_completes": 450,
"conversion_app_opens": 800,
"conversion_page_views": 1500
}
}
]
}
}
]
}

This endpoint retrieves stats for the specified Campaign.

HTTP Request

GET https://adsapi.snapchat.com/v1/campaigns/{campaign-id}/stats

Parameters

ParameterDefaultDescription
campaign-idCampaign ID

Get Ad Squad Stats

curl "https://adsapi.snapchat.com/v1/adsquads/260ea29d-8380-4103-90cd-89a326090b01/stats?granularity=TOTAL&fields=impressions,swipes,conversion_purchase,conversion_save,conversion_start_checkout,conversion_add_cart,conversion_view_content,conversion_add_billing,conversion_sign_up,conversion_search,conversion_level_complete,conversion_app_open,conversion_page_view" \
-H "Authorization: Bearer meowmeowmeow"

The above command returns JSON structured like this:

{
"request_status": "SUCCESS",
"request_id": "5907c1c300ff0724e2dea334690001737e616473617069736300016275696c642d62663930383438312d312d36322d3200010154",
"total_stats": [
{
"sub_request_status": "SUCCESS",
"total_stat": {
"id": "260ea29d-8380-4103-90cd-89a326090b01",
"type": "AD_SQUAD",
"granularity": "TOTAL",
"stats": {
"impressions": 15430,
"swipes": 114,
"conversion_purchases": 400,
"conversion_save": 300,
"conversion_start_checkout": 600,
"conversion_add_cart": 1000,
"conversion_view_content": 1570,
"conversion_add_billing": 1332,
"conversion_sign_ups": 2000,
"conversion_searches": 3000,
"conversion_level_completes": 900,
"conversion_app_opens": 1600,
"conversion_page_views": 3000
},
"finalized_data_end_time": "2017-05-01T00:00:00.000-07:00"
}
}
]
}

This endpoint retrieves stats for the specified Ad Squad.

HTTP Request

GET https://adsapi.snapchat.com/v1/adsquads/{adsquad-id}/stats

Parameters

ParameterDefaultDescription
adsquad-idAd Squad ID

Get Ad Stats

curl "https://adsapi.snapchat.com/v1/ads/482fa116-95c1-43c9-8d17-5a6dc3330d41/stats?granularity=HOUR&fields=impressions,swipes,conversion_purchases,conversion_save,conversion_start_checkout,conversion_add_cart,conversion_view_content,conversion_add_billing,conversion_sign_ups,conversion_searches,conversion_level_completes,conversion_app_opens,conversion_page_views&start_time=2017-04-30T07:00:00.000-00:00&end_time=2017-04-30T10:00:00.000-00:00" \
-H "Authorization: Bearer meowmeowmeow"

The above command returns JSON structured like this:

{
"request_status": "SUCCESS",
"request_id": "5907cec100ff0aef6f08499b460001737e616473617069736300016275696c642d62663930383438312d312d36322d3200010145",
"timeseries_stats": [
{
"sub_request_status": "SUCCESS",
"timeseries_stat": {
"id": "482fa116-95c1-43c9-8d17-5a6dc3330d41",
"type": "AD",
"granularity": "HOUR",
"start_time": "2017-04-30T00:00:00.000-07:00",
"end_time": "2017-04-30T03:00:00.000-07:00",
"finalized_data_end_time": "2017-05-01T00:00:00.000-07:00",
"timeseries": [
{
"start_time": "2017-04-30T00:00:00.000-07:00",
"end_time": "2017-04-30T01:00:00.000-07:00",
"stats": {
"impressions": 7715,
"swipes": 57,
"conversion_purchases": 200,
"conversion_save": 150,
"conversion_start_checkout": 300,
"conversion_add_cart": 500,
"conversion_view_content": 785,
"conversion_add_billing": 666,
"conversion_sign_ups": 1000,
"conversion_searches": 1500,
"conversion_level_completes": 450,
"conversion_app_opens": 800,
"conversion_page_views": 1500
}
},
{
"start_time": "2017-04-30T01:00:00.000-07:00",
"end_time": "2017-04-30T02:00:00.000-07:00",
"stats": {
"impressions": 7715,
"swipes": 57,
"conversion_purchases": 200,
"conversion_save": 150,
"conversion_start_checkout": 300,
"conversion_add_cart": 500,
"conversion_view_content": 785,
"conversion_add_billing": 666,
"conversion_sign_ups": 1000,
"conversion_searches": 1500,
"conversion_level_completes": 450,
"conversion_app_opens": 800,
"conversion_page_views": 1500
}
},
{
"start_time": "2017-04-30T02:00:00.000-07:00",
"end_time": "2017-04-30T03:00:00.000-07:00",
"stats": {
"impressions": 7715,
"swipes": 57,
"conversion_purchases": 200,
"conversion_save": 150,
"conversion_start_checkout": 300,
"conversion_add_cart": 500,
"conversion_view_content": 785,
"conversion_add_billing": 666,
"conversion_sign_ups": 1000,
"conversion_searches": 1500,
"conversion_level_completes": 450,
"conversion_app_opens": 800,
"conversion_page_views": 1500
}
}
]
}
}
]
}

This endpoint retrieves stats for the specified Ad.

HTTP Request

GET https://adsapi.snapchat.com/v1/ads/{ad-id}/stats

Parameters

ParameterDefaultDescription
ad-idAd ID

Get Pixel Domains

curl "https://adsapi.snapchat.com/v1/pixels/57ad1ad-600076e-58fa375-e19284/domains/stats" \
-H "Authorization: Bearer meowmeowmeow"

The above command returns JSON structured like this:

{
"request_status": "SUCCESS",
"request_id": "59b1e63000ff0aeee681bf3ac50001737e616473617069736300016275696c642d64333736306564362d312d39382d3100010123",
"timeseries_stats": [
{
"sub_request_status": "SUCCESS",
"timeseries_stat": {
"id": "6c9d82ca-4a3a-4391-98ba-0317a8471296",
"type": "PIXEL",
"start_time": "2017-08-31T18:00:00.000-07:00",
"end_time": "2017-09-07T18:00:00.000-07:00",
"domains": [
{
"domain_name": "abc.snapchat.com",
"total_events": 30
},
{
"domain_name": "xyz.snapchat.com",
"total_events": 8
},
{
"domain_name": "snapchat.com",
"total_events": 180886
},
{
"domain_name": "www.snapchat.com",
"total_events": 9682034
}
]
}
}
]
}

This endpoint retrieves the domains that have fired the pixel in the past 7 days.

HTTP Request

GET https://adsapi.snapchat.com/v1/pixels/{pixel-id}/domains/stats

Parameters

ParameterDefaultDescription
pixel-idPixel ID

Get Pixel Stats for a specific domain

curl "https://adsapi.snapchat.com//v1/pixels/57ad1ad-600076e-58fa375-e19284/stats?start_time=2017-08-31T18:00:00.000-07:00&end_time=2017-09-07T18:00:00.000-07:00&granularity=DAY&domain=abc.snapchat.com&fields=event_type,os_type,browser_type" \
-H "Authorization: Bearer meowmeowmeow"

The above command returns JSON structured like this:

{
"request_status": "SUCCESS",
"request_id": "59b1eac600ff088c614606e13d0001737e616473617069736300016275696c642d64333736306564362d312d39382d3100010157",
"timeseries_stats": [
{
"sub_request_status": "SUCCESS",
"timeseries_stat": {
"id": "6c9d82ca-4a3a-4391-98ba-0317a8471234",
"type": "PIXEL",
"granularity": "DAY",
"start_time": "2017-08-31T18:00:00.000-07:00",
"end_time": "2017-09-07T18:00:00.000-07:00",
"timeseries": [
{
"start_time": "2017-08-31T00:00:00.000-07:00",
"end_time": "2017-09-01T00:00:00.000-07:00",
"total_events": 253926,
"event_type_breakdown": {
"VIEW_CONTENT": 13560,
"PAGE_VIEW": 240366
},
"os_type_breakdown": {
"MAC_OS_X": 1,
"IOS": 217753,
"ANDROID": 36170,
"LINUX": 2
},
"browser_type_breakdown": {
"FIREFOX": 4,
"BROWSER_TYPE_OTHER": 154,
"SAFARI": 217747,
"CHROME": 36021
}
},
{
"start_time": "2017-09-01T00:00:00.000-07:00",
"end_time": "2017-09-02T00:00:00.000-07:00",
"total_events": 873039,
"event_type_breakdown": {
"VIEW_CONTENT": 36094,
"PAGE_VIEW": 836945
},
"os_type_breakdown": {
"IOS": 738139,
"ANDROID": 134867,
"MAC_OS_X": 17,
"LINUX": 2,
"WINDOW": 14
},
"browser_type_breakdown": {
"BROWSER_TYPE_OTHER": 709,
"SAFARI": 738135,
"CHROME": 134163,
"FIREFOX": 22,
"INTERNET_EXPLORER": 4,
"OPERA": 5,
"EDGE": 1
}
},
[[snip]]
{
"start_time": "2017-09-07T00:00:00.000-07:00",
"end_time": "2017-09-08T00:00:00.000-07:00",
"total_events": 1675610,
"event_type_breakdown": {
"VIEW_CONTENT": 82831,
"PAGE_VIEW": 1592779
},
"os_type_breakdown": {
"IOS": 1363740,
"ANDROID": 311818,
"MAC_OS_X": 11,
"WINDOW": 40,
"LINUX": 1
},
"browser_type_breakdown": {
"BROWSER_TYPE_OTHER": 570,
"SAFARI": 1363719,
"CHROME": 311301,
"FIREFOX": 17,
"OPERA": 3
}
}
],
"domain": "abc.snapchat.com"
}
}
]
}

This endpoint retrieves the pixel stats for a specified domain. You can retrieve stats for a specific domain looking back 7 days from current time.

HTTP Request

GET https://adsapi.snapchat.com/v1/pixels/{pixel-id}/stats

Parameters

ParameterDefaultDescription
pixel-idPixel ID

Query Paramters

Query ParameterDescriptionRequiredPossible Values
start_timeStart Time (ISO 8601)Yes
end_timeEnd Time (ISO 8601)Yes
granularityGranularity for the dataYesDAY, HOUR
domainDomain nameYesValid domain name
fieldsComma-separated list of fields to retrieveYesEVENT_TYPE, OS_TYPE, BROWSER_TYPE
Was this page helpful?
Yes
No

AI-Powered Search