{"count":5,"next":null,"previous":null,"results":[{"id":"template-google-tag-manager","name":"Google Tag Manager","description":"Load Google Tag Manager within your website","code":"// Adds window.dataLayer and lazily loads the Google Tag Manager script\nfunction initSnippet(containerId) {\n    (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=!0;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f)})(window,document,'script','dataLayer',containerId)\n}\n\nexport async function onLoad({ inputs, posthog }) {\n    initSnippet(inputs.containerId);\n    \n    if (posthog.config.debug) {\n        console.log('[PostHog] Google Tag Manager init', inputs.containerId);\n    }\n}\nexport function onEvent({ inputs, posthog }) {\n    if (posthog.config.debug) {\n        console.log('[PostHog] Google Tag Manager track', inputs.containerId, inputs.payload);\n    }\n    dataLayer.push(inputs.payload);\n}","code_language":"javascript","inputs_schema":[{"key":"containerId","type":"string","label":"Container ID","secret":false,"default":"","required":true,"description":"You can find your Container ID in your [Accounts page](https://www.google.com/tagmanager/web/#management/Accounts/)."}],"type":"site_destination","status":"stable","category":["Custom"],"free":true,"icon_url":"/static/services/google-tag-manager.png","filters":null,"masking":null,"mapping_templates":[{"name":"Pageview","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"$pageview","name":"Pageview","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"payload","type":"dictionary","label":"payload","secret":false,"default":{"url":"{event.properties.$current_url}","event":"{event.event}","title":"{event.properties.title}"},"required":false,"description":"Payload to send to Google Tag Manager."}]}]},{"id":"template-reddit-pixel","name":"Reddit Pixel","description":"Track how many Reddit users interact with your website. Note that this destination will set third-party cookies.","code":"// Adds window.rdt and lazily loads the Reddit Pixel script\nfunction initSnippet() {\n    !function(w,d){if(!w.rdt){var p=w.rdt=function(){p.sendEvent?p.sendEvent.apply(p,arguments):p.callQueue.push(arguments)};p.callQueue=[];var t=d.createElement(\"script\");t.src=\"https://www.redditstatic.com/ads/pixel.js\",t.async=!0;var s=d.getElementsByTagName(\"script\")[0];s.parentNode.insertBefore(t,s)}}(window,document);\n}\n\n// These are the event names which we are allowed to call rdt with. If we want to send a different event name, we will\n// need to use the 'Custom' event name, and pass original event name as 'customEventName' in event properties.\nconst RDT_ALLOWED_EVENT_NAMES = [\n    'PageVisit',\n    'Search',\n    'AddToCart',\n    'AddToWishlist',\n    'Purchase',\n    'ViewContent',\n    'Lead',\n    'SignUp',\n    'Custom',\n];\n\nexport function onLoad({ inputs, posthog }) {\n    initSnippet();\n    let userProperties = {};\n    for (const [key, value] of Object.entries(inputs.userProperties)) {\n        if (value) {\n            userProperties[key] = value;\n        }\n    };\n    if (posthog.config.debug) {\n        console.log('[PostHog] rdt init', inputs.pixelId, userProperties);\n    }\n    rdt('init', inputs.pixelId, userProperties);\n}\nexport function onEvent({ inputs, posthog }) {\n\n    let eventProperties = {};\n    for (const [key, value] of Object.entries(inputs.eventProperties)) {\n        if (value) {\n            eventProperties[key] = value;\n        }\n    };\n    let eventName;\n    if (RDT_ALLOWED_EVENT_NAMES.includes(inputs.eventType)) {\n        eventName = inputs.eventType;\n    } else {\n        eventName = 'Custom';\n        eventProperties.customEventName = inputs.eventType;\n    }\n    if (posthog.config.debug) {\n        console.log('[PostHog] rdt track', eventName, eventProperties);\n    }\n    rdt('track', eventName, eventProperties);\n}","code_language":"javascript","inputs_schema":[{"key":"pixelId","type":"string","label":"Pixel ID","secret":false,"default":"","required":true,"description":"You must obtain a Pixel ID to use the Reddit Pixel. If you've already set up a Pixel for your website, we recommend that you use the same Pixel ID for your browser and server events."},{"key":"userProperties","type":"dictionary","label":"User parameters","secret":false,"default":{"email":"{person.properties.email}"},"required":false,"description":"Map of Reddit user parameters and their values. Check out this page for more details: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel"}],"type":"site_destination","status":"alpha","category":["Advertisement"],"free":false,"icon_url":"/static/services/reddit.png","filters":null,"masking":null,"mapping_templates":[{"name":"Page Visit","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"$pageview","name":"Pageview","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"PageVisit","required":true,"description":"Check out this page for possible event types: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","currency":"{event.properties.currency}","products":"{event.properties.products ? arrayMap(product -> ({'id': product.product_id, 'category': product.category, 'name': product.name}), event.properties.products) : event.properties.product_id ? [{'id': event.properties.product_id, 'category': event.properties.category, 'name': event.properties.name}] : undefined}","conversion_id":"{event.uuid}"},"required":false,"description":"Map of Reddit event attributes and their values. Check out these pages for more details: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel and https://business.reddithelp.com/s/article/about-event-metadata"}]},{"name":"Search","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Products Searched","name":"Products Searched","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"Search","required":true,"description":"Check out this page for possible event types: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","currency":"{event.properties.currency}","products":"{event.properties.products ? arrayMap(product -> ({'id': product.product_id, 'category': product.category, 'name': product.name}), event.properties.products) : event.properties.product_id ? [{'id': event.properties.product_id, 'category': event.properties.category, 'name': event.properties.name}] : undefined}","conversion_id":"{event.uuid}"},"required":false,"description":"Map of Reddit event attributes and their values. Check out these pages for more details: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel and https://business.reddithelp.com/s/article/about-event-metadata"}]},{"name":"Product Added","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Product Added","name":"Product Added","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"AddToCart","required":true,"description":"Check out this page for possible event types: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","currency":"{event.properties.currency}","products":"{event.properties.products ? arrayMap(product -> ({'id': product.product_id, 'category': product.category, 'name': product.name}), event.properties.products) : event.properties.product_id ? [{'id': event.properties.product_id, 'category': event.properties.category, 'name': event.properties.name}] : undefined}","conversion_id":"{event.uuid}"},"required":false,"description":"Map of Reddit event attributes and their values. Check out these pages for more details: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel and https://business.reddithelp.com/s/article/about-event-metadata"}]},{"name":"Product Added to Wishlist","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Product Added to Wishlist","name":"Product Added to Wishlist","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"AddToWishlist","required":true,"description":"Check out this page for possible event types: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","currency":"{event.properties.currency}","products":"{event.properties.products ? arrayMap(product -> ({'id': product.product_id, 'category': product.category, 'name': product.name}), event.properties.products) : event.properties.product_id ? [{'id': event.properties.product_id, 'category': event.properties.category, 'name': event.properties.name}] : undefined}","conversion_id":"{event.uuid}"},"required":false,"description":"Map of Reddit event attributes and their values. Check out these pages for more details: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel and https://business.reddithelp.com/s/article/about-event-metadata"}]},{"name":"Order Completed","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Order Completed","name":"Order Completed","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"Purchase","required":true,"description":"Check out this page for possible event types: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","currency":"{event.properties.currency}","products":"{event.properties.products ? arrayMap(product -> ({'id': product.product_id, 'category': product.category, 'name': product.name}), event.properties.products) : event.properties.product_id ? [{'id': event.properties.product_id, 'category': event.properties.category, 'name': event.properties.name}] : undefined}","conversion_id":"{event.uuid}"},"required":false,"description":"Map of Reddit event attributes and their values. Check out these pages for more details: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel and https://business.reddithelp.com/s/article/about-event-metadata"}]},{"name":"Product Viewed","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Product Viewed","name":"Product Viewed","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"ViewContent","required":true,"description":"Check out this page for possible event types: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","currency":"{event.properties.currency}","products":"{event.properties.products ? arrayMap(product -> ({'id': product.product_id, 'category': product.category, 'name': product.name}), event.properties.products) : event.properties.product_id ? [{'id': event.properties.product_id, 'category': event.properties.category, 'name': event.properties.name}] : undefined}","conversion_id":"{event.uuid}"},"required":false,"description":"Map of Reddit event attributes and their values. Check out these pages for more details: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel and https://business.reddithelp.com/s/article/about-event-metadata"}]},{"name":"Lead Generated","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Lead Generated","name":"Lead Generated","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"Lead","required":true,"description":"Check out this page for possible event types: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","currency":"{event.properties.currency}","products":"{event.properties.products ? arrayMap(product -> ({'id': product.product_id, 'category': product.category, 'name': product.name}), event.properties.products) : event.properties.product_id ? [{'id': event.properties.product_id, 'category': event.properties.category, 'name': event.properties.name}] : undefined}","conversion_id":"{event.uuid}"},"required":false,"description":"Map of Reddit event attributes and their values. Check out these pages for more details: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel and https://business.reddithelp.com/s/article/about-event-metadata"}]},{"name":"Signed Up","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Signed Up","name":"Signed Up","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"SignUp","required":true,"description":"Check out this page for possible event types: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","currency":"{event.properties.currency}","products":"{event.properties.products ? arrayMap(product -> ({'id': product.product_id, 'category': product.category, 'name': product.name}), event.properties.products) : event.properties.product_id ? [{'id': event.properties.product_id, 'category': event.properties.category, 'name': event.properties.name}] : undefined}","conversion_id":"{event.uuid}"},"required":false,"description":"Map of Reddit event attributes and their values. Check out these pages for more details: https://business.reddithelp.com/s/article/manual-conversion-events-with-the-reddit-pixel and https://business.reddithelp.com/s/article/about-event-metadata"}]}]},{"id":"template-tiktok-pixel","name":"TikTok Pixel","description":"Track how many TikTok users interact with your website. Note that this destination will set third-party cookies.","code":"// Adds window.snaptr and lazily loads the TikTok Pixel script\nfunction initSnippet() {\n    !function (w, d, t) {\n    w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=[\"page\",\"track\",\"identify\",\"instances\",\"debug\",\"on\",\"off\",\"once\",\"ready\",\"alias\",\"group\",\"enableCookie\",\"disableCookie\",\"holdConsent\",\"revokeConsent\",\"grantConsent\"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(\n    var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var r=\"https://analytics.tiktok.com/i18n/pixel/events.js\",o=n&&n.partner;ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=r,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};n=document.createElement(\"script\")\n    ;n.type=\"text/javascript\",n.async=!0,n.src=r+\"?sdkid=\"+e+\"&lib=\"+t;e=document.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(n,e)};\n    }(window, document, 'ttq')\n}\n\nexport function onLoad({ inputs }) {\n    initSnippet();\n    ttq.load(inputs.pixelId);\n\n    let userProperties = {};\n    for (const [key, value] of Object.entries(inputs.userProperties)) {\n        if (value || value === '') {\n            userProperties[key] = value;\n        }\n    };\n    ttq.instance(inputs.pixelId).identify(userProperties);\n}\nexport function onEvent({ inputs }) {\n    let eventProperties = {};\n\n    for (const [key, value] of Object.entries(inputs.eventProperties)) {\n        if (value !== undefined) {\n            eventProperties[key] = value;\n        }\n    };\n\n    if (inputs.contentType !== undefined) {\n        eventProperties.content_type = inputs.contentType;\n    }\n\n    ttq.instance(inputs.pixelId).track(\n        inputs.eventType,\n        eventProperties,\n        {\n            event_id: inputs.eventId\n        }\n    );\n}","code_language":"javascript","inputs_schema":[{"key":"pixelId","type":"string","label":"Pixel ID","secret":false,"default":"","required":true,"description":"You must obtain a Pixel ID to use the TikTok Pixel. If you've already set up a Pixel for your website, we recommend that you use the same Pixel ID for your browser and server events."},{"key":"userProperties","type":"dictionary","label":"User parameters","secret":false,"default":{"ip":"{event.properties.$ip}","city":"{not empty(person.properties.$geoip_city_name) ? replaceAll(lower(person.properties.$geoip_city_name), ' ', '') : null}","email":"{not empty(person.properties.email) ? sha256Hex(lower(person.properties.email)) : ''}","phone":"{not empty(person.properties.phone) ? sha256Hex(person.properties.phone) : ''}","state":"{lower(person.properties.$geoip_subdivision_1_code)}","ttclid":"{person.properties.ttclid ?? person.properties.$initial_ttclid}","country":"{lower(person.properties.$geoip_country_code)}","zip_code":"{not empty (person.properties.$geoip_postal_code) ? sha256Hex(replaceAll(lower(person.properties.$geoip_postal_code), ' ', '')) : null}","last_name":"{not empty(person.properties.last_name) ? sha256Hex(lower(person.properties.last_name)) : ''}","first_name":"{not empty(person.properties.first_name) ? sha256Hex(lower(person.properties.first_name)) : ''}","user_agent":"{event.properties.$raw_user_agent}","external_id":"{not empty(person.id) ? sha256Hex(person.id) : ''}"},"required":false,"description":"Map of TikTok user parameters and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585700402178#item-link-Identity%20information%20supported"}],"type":"site_destination","status":"alpha","category":["Advertisement"],"free":false,"icon_url":"/static/services/tiktok.png","filters":null,"masking":null,"mapping_templates":[{"name":"Page Viewed","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"$pageview","name":"Pageview","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"Pageview","required":true,"description":"Check out this page for possible event types: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Event%20codes"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","contents":"{[{ 'content_id': event.properties.product_id, 'price': event.properties.price, 'content_category': event.properties.category, 'content_name': event.properties.name, 'brand': event.properties.brand, 'quantity': event.properties.quantity }]}","currency":"{event.properties.currency ?? 'USD'}","num_items":"{event.properties.quantity}","content_ids":"{event.properties.product_id ? [event.properties.product_id] : null}","description":"","search_string":"{event.properties.query}"},"required":false,"description":"Map of TikTok event attributes and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Parameters"},{"key":"contentType","type":"choice","label":"Content Type","secret":false,"choices":[{"label":"Product","value":"product"},{"label":"Product Group","value":"product_group"}],"default":"product","required":true,"description":"Type of the product item. When the content_id in the Contents field is specified as a sku_id, set this field to product. When the content_id in the Contents field is specified as an item_group_id, set this field to product_group."},{"key":"eventId","type":"string","label":"Event ID","secret":false,"default":"{event.uuid}","required":true,"description":"The ID of the event. This will be used for deduplication. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1771100965992450"}]},{"name":"Order Completed","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Order Completed","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"CompletePayment","required":true,"description":"Check out this page for possible event types: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Event%20codes"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","contents":"{arrayMap(product -> ({ 'content_id': product.product_id, 'price': product.price, 'content_category': product.category, 'content_name': product.name, 'brand': product.brand, 'quantity': product.quantity }), event.properties.products ?? [])}","currency":"{event.properties.currency ?? 'USD'}","num_items":"{arrayReduce((acc, curr) -> acc + curr.quantity, event.properties.products ?? [], 0)}","content_ids":"{arrayMap(product -> product.product_id, event.properties.products ?? [])}","description":"","search_string":"{event.properties.query}"},"required":false,"description":"Map of TikTok event attributes and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Parameters"},{"key":"contentType","type":"choice","label":"Content Type","secret":false,"choices":[{"label":"Product","value":"product"},{"label":"Product Group","value":"product_group"}],"default":"product_group","required":true,"description":"Type of the product item. When the content_id in the Contents field is specified as a sku_id, set this field to product. When the content_id in the Contents field is specified as an item_group_id, set this field to product_group."},{"key":"eventId","type":"string","label":"Event ID","secret":false,"default":"{event.uuid}","required":true,"description":"The ID of the event. This will be used for deduplication. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1771100965992450"}]},{"name":"Product Viewed","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Product Viewed","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"ViewContent","required":true,"description":"Check out this page for possible event types: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Event%20codes"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","contents":"{[{ 'content_id': event.properties.product_id, 'price': event.properties.price, 'content_category': event.properties.category, 'content_name': event.properties.name, 'brand': event.properties.brand, 'quantity': event.properties.quantity }]}","currency":"{event.properties.currency ?? 'USD'}","num_items":"{event.properties.quantity}","content_ids":"{event.properties.product_id ? [event.properties.product_id] : null}","description":"","search_string":"{event.properties.query}"},"required":false,"description":"Map of TikTok event attributes and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Parameters"},{"key":"contentType","type":"choice","label":"Content Type","secret":false,"choices":[{"label":"Product","value":"product"},{"label":"Product Group","value":"product_group"}],"default":"product","required":true,"description":"Type of the product item. When the content_id in the Contents field is specified as a sku_id, set this field to product. When the content_id in the Contents field is specified as an item_group_id, set this field to product_group."},{"key":"eventId","type":"string","label":"Event ID","secret":false,"default":"{event.uuid}","required":true,"description":"The ID of the event. This will be used for deduplication. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1771100965992450"}]},{"name":"Product Clicked","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Product Clicked","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"ClickButton","required":true,"description":"Check out this page for possible event types: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Event%20codes"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","contents":"{[{ 'content_id': event.properties.product_id, 'price': event.properties.price, 'content_category': event.properties.category, 'content_name': event.properties.name, 'brand': event.properties.brand, 'quantity': event.properties.quantity }]}","currency":"{event.properties.currency ?? 'USD'}","num_items":"{event.properties.quantity}","content_ids":"{event.properties.product_id ? [event.properties.product_id] : null}","description":"","search_string":"{event.properties.query}"},"required":false,"description":"Map of TikTok event attributes and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Parameters"},{"key":"contentType","type":"choice","label":"Content Type","secret":false,"choices":[{"label":"Product","value":"product"},{"label":"Product Group","value":"product_group"}],"default":"product","required":true,"description":"Type of the product item. When the content_id in the Contents field is specified as a sku_id, set this field to product. When the content_id in the Contents field is specified as an item_group_id, set this field to product_group."},{"key":"eventId","type":"string","label":"Event ID","secret":false,"default":"{event.uuid}","required":true,"description":"The ID of the event. This will be used for deduplication. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1771100965992450"}]},{"name":"Products Searched","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Products Searched","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"Search","required":true,"description":"Check out this page for possible event types: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Event%20codes"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","contents":"{[{ 'content_id': event.properties.product_id, 'price': event.properties.price, 'content_category': event.properties.category, 'content_name': event.properties.name, 'brand': event.properties.brand, 'quantity': event.properties.quantity }]}","currency":"{event.properties.currency ?? 'USD'}","num_items":"{event.properties.quantity}","content_ids":"{event.properties.product_id ? [event.properties.product_id] : null}","description":"","search_string":"{event.properties.query}"},"required":false,"description":"Map of TikTok event attributes and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Parameters"},{"key":"contentType","type":"choice","label":"Content Type","secret":false,"choices":[{"label":"Product","value":"product"},{"label":"Product Group","value":"product_group"}],"default":"product","required":true,"description":"Type of the product item. When the content_id in the Contents field is specified as a sku_id, set this field to product. When the content_id in the Contents field is specified as an item_group_id, set this field to product_group."},{"key":"eventId","type":"string","label":"Event ID","secret":false,"default":"{event.uuid}","required":true,"description":"The ID of the event. This will be used for deduplication. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1771100965992450"}]},{"name":"Add to Wishlist","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Add to Wishlist","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"AddToWishlist","required":true,"description":"Check out this page for possible event types: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Event%20codes"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","contents":"{[{ 'content_id': event.properties.product_id, 'price': event.properties.price, 'content_category': event.properties.category, 'content_name': event.properties.name, 'brand': event.properties.brand, 'quantity': event.properties.quantity }]}","currency":"{event.properties.currency ?? 'USD'}","num_items":"{event.properties.quantity}","content_ids":"{event.properties.product_id ? [event.properties.product_id] : null}","description":"","search_string":"{event.properties.query}"},"required":false,"description":"Map of TikTok event attributes and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Parameters"},{"key":"contentType","type":"choice","label":"Content Type","secret":false,"choices":[{"label":"Product","value":"product"},{"label":"Product Group","value":"product_group"}],"default":"product","required":true,"description":"Type of the product item. When the content_id in the Contents field is specified as a sku_id, set this field to product. When the content_id in the Contents field is specified as an item_group_id, set this field to product_group."},{"key":"eventId","type":"string","label":"Event ID","secret":false,"default":"{event.uuid}","required":true,"description":"The ID of the event. This will be used for deduplication. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1771100965992450"}]},{"name":"Product Added","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Product Added","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"AddToCart","required":true,"description":"Check out this page for possible event types: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Event%20codes"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","contents":"{[{ 'content_id': event.properties.product_id, 'price': event.properties.price, 'content_category': event.properties.category, 'content_name': event.properties.name, 'brand': event.properties.brand, 'quantity': event.properties.quantity }]}","currency":"{event.properties.currency ?? 'USD'}","num_items":"{event.properties.quantity}","content_ids":"{event.properties.product_id ? [event.properties.product_id] : null}","description":"","search_string":"{event.properties.query}"},"required":false,"description":"Map of TikTok event attributes and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Parameters"},{"key":"contentType","type":"choice","label":"Content Type","secret":false,"choices":[{"label":"Product","value":"product"},{"label":"Product Group","value":"product_group"}],"default":"product","required":true,"description":"Type of the product item. When the content_id in the Contents field is specified as a sku_id, set this field to product. When the content_id in the Contents field is specified as an item_group_id, set this field to product_group."},{"key":"eventId","type":"string","label":"Event ID","secret":false,"default":"{event.uuid}","required":true,"description":"The ID of the event. This will be used for deduplication. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1771100965992450"}]},{"name":"Checkout Started","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Checkout Started","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"InitiateCheckout","required":true,"description":"Check out this page for possible event types: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Event%20codes"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","contents":"{arrayMap(product -> ({ 'content_id': product.product_id, 'price': product.price, 'content_category': product.category, 'content_name': product.name, 'brand': product.brand, 'quantity': product.quantity }), event.properties.products ?? [])}","currency":"{event.properties.currency ?? 'USD'}","num_items":"{arrayReduce((acc, curr) -> acc + curr.quantity, event.properties.products ?? [], 0)}","content_ids":"{arrayMap(product -> product.product_id, event.properties.products ?? [])}","description":"","search_string":"{event.properties.query}"},"required":false,"description":"Map of TikTok event attributes and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Parameters"},{"key":"contentType","type":"choice","label":"Content Type","secret":false,"choices":[{"label":"Product","value":"product"},{"label":"Product Group","value":"product_group"}],"default":"product_group","required":true,"description":"Type of the product item. When the content_id in the Contents field is specified as a sku_id, set this field to product. When the content_id in the Contents field is specified as an item_group_id, set this field to product_group."},{"key":"eventId","type":"string","label":"Event ID","secret":false,"default":"{event.uuid}","required":true,"description":"The ID of the event. This will be used for deduplication. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1771100965992450"}]},{"name":"Add Payment Info","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Add Payment Info","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"AddPaymentInfo","required":true,"description":"Check out this page for possible event types: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Event%20codes"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","contents":"{arrayMap(product -> ({ 'content_id': product.product_id, 'price': product.price, 'content_category': product.category, 'content_name': product.name, 'brand': product.brand, 'quantity': product.quantity }), event.properties.products ?? [])}","currency":"{event.properties.currency ?? 'USD'}","num_items":"{arrayReduce((acc, curr) -> acc + curr.quantity, event.properties.products ?? [], 0)}","content_ids":"{arrayMap(product -> product.product_id, event.properties.products ?? [])}","description":"","search_string":"{event.properties.query}"},"required":false,"description":"Map of TikTok event attributes and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Parameters"},{"key":"contentType","type":"choice","label":"Content Type","secret":false,"choices":[{"label":"Product","value":"product"},{"label":"Product Group","value":"product_group"}],"default":"product_group","required":true,"description":"Type of the product item. When the content_id in the Contents field is specified as a sku_id, set this field to product. When the content_id in the Contents field is specified as an item_group_id, set this field to product_group."},{"key":"eventId","type":"string","label":"Event ID","secret":false,"default":"{event.uuid}","required":true,"description":"The ID of the event. This will be used for deduplication. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1771100965992450"}]},{"name":"Order Placed","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Order Placed","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"PlaceAnOrder","required":true,"description":"Check out this page for possible event types: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Event%20codes"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","contents":"{arrayMap(product -> ({ 'content_id': product.product_id, 'price': product.price, 'content_category': product.category, 'content_name': product.name, 'brand': product.brand, 'quantity': product.quantity }), event.properties.products ?? [])}","currency":"{event.properties.currency ?? 'USD'}","num_items":"{arrayReduce((acc, curr) -> acc + curr.quantity, event.properties.products ?? [], 0)}","content_ids":"{arrayMap(product -> product.product_id, event.properties.products ?? [])}","description":"","search_string":"{event.properties.query}"},"required":false,"description":"Map of TikTok event attributes and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Parameters"},{"key":"contentType","type":"choice","label":"Content Type","secret":false,"choices":[{"label":"Product","value":"product"},{"label":"Product Group","value":"product_group"}],"default":"product_group","required":true,"description":"Type of the product item. When the content_id in the Contents field is specified as a sku_id, set this field to product. When the content_id in the Contents field is specified as an item_group_id, set this field to product_group."},{"key":"eventId","type":"string","label":"Event ID","secret":false,"default":"{event.uuid}","required":true,"description":"The ID of the event. This will be used for deduplication. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1771100965992450"}]},{"name":"Signed Up","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Signed Up","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"CompleteRegistration","required":true,"description":"Check out this page for possible event types: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Event%20codes"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"value":"{toFloat(event.properties.value ?? event.properties.revenue ?? event.properties.price)}","contents":"{arrayMap(product -> ({ 'content_id': product.product_id, 'price': product.price, 'content_category': product.category, 'content_name': product.name, 'brand': product.brand, 'quantity': product.quantity }), event.properties.products ?? [])}","currency":"{event.properties.currency ?? 'USD'}","num_items":"{arrayReduce((acc, curr) -> acc + curr.quantity, event.properties.products ?? [], 0)}","content_ids":"{arrayMap(product -> product.product_id, event.properties.products ?? [])}","description":"","search_string":"{event.properties.query}"},"required":false,"description":"Map of TikTok event attributes and their values. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1739585702922241#item-link-Parameters"},{"key":"contentType","type":"choice","label":"Content Type","secret":false,"choices":[{"label":"Product","value":"product"},{"label":"Product Group","value":"product_group"}],"default":"product_group","required":true,"description":"Type of the product item. When the content_id in the Contents field is specified as a sku_id, set this field to product. When the content_id in the Contents field is specified as an item_group_id, set this field to product_group."},{"key":"eventId","type":"string","label":"Event ID","secret":false,"default":"{event.uuid}","required":true,"description":"The ID of the event. This will be used for deduplication. Check out this page for more details: https://business-api.tiktok.com/portal/docs?id=1771100965992450"}]}]},{"id":"template-snapchat-pixel","name":"Snapchat Pixel","description":"Track how many Snapchat users interact with your website. Note that this destination will set third-party cookies.","code":"// Adds window.snaptr and lazily loads the Snapchat Pixel script\nfunction initSnippet() {\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)};\n    a.queue=[];var s='script';r=t.createElement(s);r.async=!0;\n    r.src=n;var u=t.getElementsByTagName(s)[0];\n    u.parentNode.insertBefore(r,u);})(window,document,\n    'https://sc-static.net/scevent.min.js');\n}\n\nexport function onLoad({ inputs, posthog }) {\n    initSnippet();\n    let userProperties = {};\n    for (const [key, value] of Object.entries(inputs.userProperties)) {\n        if (value) {\n            userProperties[key] = value;\n        }\n    };\n    if (posthog.config.debug) {\n        console.log('[PostHog] snaptr init', inputs.pixelId, userProperties);\n    }\n    snaptr('init', inputs.pixelId, userProperties);\n}\nexport function onEvent({ inputs, posthog }) {\n    let eventProperties = {};\n    for (const [key, value] of Object.entries(inputs.eventProperties)) {\n        if (value) {\n            eventProperties[key] = value;\n        }\n    };\n    if (posthog.config.debug) {\n        console.log('[PostHog] snaptr track', inputs.eventType, eventProperties);\n    }\n    snaptr('track', inputs.eventType, eventProperties);\n}","code_language":"javascript","inputs_schema":[{"key":"pixelId","type":"string","label":"Pixel ID","secret":false,"default":"","required":true,"description":"You must obtain a Pixel ID to use the Snapchat Pixel. If you've already set up a Pixel for your website, we recommend that you use the same Pixel ID for your browser and server events."},{"key":"userProperties","type":"dictionary","label":"User parameters","secret":false,"default":{"user_email":"{person.properties.email}","user_phone_number":"{person.properties.phone}"},"required":false,"description":"Map of Snapchat user parameters and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}],"type":"site_destination","status":"alpha","category":["Advertisement"],"free":false,"icon_url":"/static/services/snapchat.png","filters":null,"masking":null,"mapping_templates":[{"name":"Page Viewed","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"$pageview","name":"Pageview","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"PAGE_VIEW","required":true,"description":"Check out this page for possible event types: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"price":"{toFloat(event.properties.price ?? event.properties.value ?? event.properties.revenue)}","brands":"{event.properties.brands}","success":"{toInt(event.properties.success) in (0, 1) ? toInt(event.properties.success) : null}","currency":"{event.properties.currency}","item_ids":"{event.properties.sku}","description":"{event.properties.description}","number_items":"{event.properties.quantity}","item_category":"{event.properties.category}","search_string":"{event.properties.search_string}","sign_up_method":"{event.properties.sign_up_method}","transaction_id":"{event.properties.orderId ?? event.properties.transactionId ?? event.properties.transaction_id}","client_dedup_id":"{event.uuid}","payment_info_available":"{toInt(event.properties.payment_info_available)}"},"required":false,"description":"Map of Snapchat event attributes and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}]},{"name":"Order Completed","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Order Completed","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"PURCHASE","required":true,"description":"Check out this page for possible event types: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"price":"{toFloat(event.properties.price ?? event.properties.value ?? event.properties.revenue)}","brands":"{arrayMap(x -> x.brands, event.properties.products ?? [])}","success":"{toInt(event.properties.success) in (0, 1) ? toInt(event.properties.success) : null}","currency":"{event.properties.currency}","item_ids":"{arrayMap(x -> x.sku, event.properties.products ?? [])}","description":"{event.properties.description}","number_items":"{arrayReduce((acc, curr) -> acc + curr.quantity, event.properties.products ?? [], 0)}","item_category":"{arrayMap(x -> x.category, event.properties.products ?? [])}","search_string":"{event.properties.search_string}","sign_up_method":"{event.properties.sign_up_method}","transaction_id":"{event.properties.orderId ?? event.properties.transactionId ?? event.properties.transaction_id}","client_dedup_id":"{event.uuid}","payment_info_available":"{toInt(event.properties.payment_info_available)}"},"required":false,"description":"Map of Snapchat event attributes and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}]},{"name":"Checkout Started","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Checkout Started","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"START_CHECKOUT","required":true,"description":"Check out this page for possible event types: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"price":"{toFloat(event.properties.price ?? event.properties.value ?? event.properties.revenue)}","brands":"{arrayMap(x -> x.brands, event.properties.products ?? [])}","success":"{toInt(event.properties.success) in (0, 1) ? toInt(event.properties.success) : null}","currency":"{event.properties.currency}","item_ids":"{arrayMap(x -> x.sku, event.properties.products ?? [])}","description":"{event.properties.description}","number_items":"{arrayReduce((acc, curr) -> acc + curr.quantity, event.properties.products ?? [], 0)}","item_category":"{arrayMap(x -> x.category, event.properties.products ?? [])}","search_string":"{event.properties.search_string}","sign_up_method":"{event.properties.sign_up_method}","transaction_id":"{event.properties.orderId ?? event.properties.transactionId ?? event.properties.transaction_id}","client_dedup_id":"{event.uuid}","payment_info_available":"{toInt(event.properties.payment_info_available)}"},"required":false,"description":"Map of Snapchat event attributes and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}]},{"name":"Product Added","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Product Added","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"ADD_CART","required":true,"description":"Check out this page for possible event types: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"price":"{toFloat(event.properties.price ?? event.properties.value ?? event.properties.revenue)}","brands":"{event.properties.brands}","success":"{toInt(event.properties.success) in (0, 1) ? toInt(event.properties.success) : null}","currency":"{event.properties.currency}","item_ids":"{event.properties.sku}","description":"{event.properties.description}","number_items":"{event.properties.quantity}","item_category":"{event.properties.category}","search_string":"{event.properties.search_string}","sign_up_method":"{event.properties.sign_up_method}","transaction_id":"{event.properties.orderId ?? event.properties.transactionId ?? event.properties.transaction_id}","client_dedup_id":"{event.uuid}","payment_info_available":"{toInt(event.properties.payment_info_available)}"},"required":false,"description":"Map of Snapchat event attributes and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}]},{"name":"Payment Info Entered","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Payment Info Entered","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"ADD_BILLING","required":true,"description":"Check out this page for possible event types: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"price":"{toFloat(event.properties.price ?? event.properties.value ?? event.properties.revenue)}","brands":"{event.properties.brands}","success":"{toInt(event.properties.success) in (0, 1) ? toInt(event.properties.success) : null}","currency":"{event.properties.currency}","item_ids":"{event.properties.sku}","description":"{event.properties.description}","number_items":"{event.properties.quantity}","item_category":"{event.properties.category}","search_string":"{event.properties.search_string}","sign_up_method":"{event.properties.sign_up_method}","transaction_id":"{event.properties.orderId ?? event.properties.transactionId ?? event.properties.transaction_id}","client_dedup_id":"{event.uuid}","payment_info_available":"{toInt(event.properties.payment_info_available)}"},"required":false,"description":"Map of Snapchat event attributes and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}]},{"name":"Promotion Clicked","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Promotion Clicked","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"AD_CLICK","required":true,"description":"Check out this page for possible event types: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"price":"{toFloat(event.properties.price ?? event.properties.value ?? event.properties.revenue)}","brands":"{event.properties.brands}","success":"{toInt(event.properties.success) in (0, 1) ? toInt(event.properties.success) : null}","currency":"{event.properties.currency}","item_ids":"{event.properties.sku}","description":"{event.properties.description}","number_items":"{event.properties.quantity}","item_category":"{event.properties.category}","search_string":"{event.properties.search_string}","sign_up_method":"{event.properties.sign_up_method}","transaction_id":"{event.properties.orderId ?? event.properties.transactionId ?? event.properties.transaction_id}","client_dedup_id":"{event.uuid}","payment_info_available":"{toInt(event.properties.payment_info_available)}"},"required":false,"description":"Map of Snapchat event attributes and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}]},{"name":"Promotion Viewed","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Promotion Viewed","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"AD_VIEW","required":true,"description":"Check out this page for possible event types: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"price":"{toFloat(event.properties.price ?? event.properties.value ?? event.properties.revenue)}","brands":"{event.properties.brands}","success":"{toInt(event.properties.success) in (0, 1) ? toInt(event.properties.success) : null}","currency":"{event.properties.currency}","item_ids":"{event.properties.sku}","description":"{event.properties.description}","number_items":"{event.properties.quantity}","item_category":"{event.properties.category}","search_string":"{event.properties.search_string}","sign_up_method":"{event.properties.sign_up_method}","transaction_id":"{event.properties.orderId ?? event.properties.transactionId ?? event.properties.transaction_id}","client_dedup_id":"{event.uuid}","payment_info_available":"{toInt(event.properties.payment_info_available)}"},"required":false,"description":"Map of Snapchat event attributes and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}]},{"name":"Product Added to Wishlist","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Product Added to Wishlist","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"ADD_TO_WISHLIST","required":true,"description":"Check out this page for possible event types: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"price":"{toFloat(event.properties.price ?? event.properties.value ?? event.properties.revenue)}","brands":"{event.properties.brands}","success":"{toInt(event.properties.success) in (0, 1) ? toInt(event.properties.success) : null}","currency":"{event.properties.currency}","item_ids":"{event.properties.sku}","description":"{event.properties.description}","number_items":"{event.properties.quantity}","item_category":"{event.properties.category}","search_string":"{event.properties.search_string}","sign_up_method":"{event.properties.sign_up_method}","transaction_id":"{event.properties.orderId ?? event.properties.transactionId ?? event.properties.transaction_id}","client_dedup_id":"{event.uuid}","payment_info_available":"{toInt(event.properties.payment_info_available)}"},"required":false,"description":"Map of Snapchat event attributes and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}]},{"name":"Product Viewed","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Product Viewed","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"VIEW_CONTENT","required":true,"description":"Check out this page for possible event types: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"price":"{toFloat(event.properties.price ?? event.properties.value ?? event.properties.revenue)}","brands":"{event.properties.brands}","success":"{toInt(event.properties.success) in (0, 1) ? toInt(event.properties.success) : null}","currency":"{event.properties.currency}","item_ids":"{event.properties.sku}","description":"{event.properties.description}","number_items":"{event.properties.quantity}","item_category":"{event.properties.category}","search_string":"{event.properties.search_string}","sign_up_method":"{event.properties.sign_up_method}","transaction_id":"{event.properties.orderId ?? event.properties.transactionId ?? event.properties.transaction_id}","client_dedup_id":"{event.uuid}","payment_info_available":"{toInt(event.properties.payment_info_available)}"},"required":false,"description":"Map of Snapchat event attributes and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}]},{"name":"Product List Viewed","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Product List Viewed","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"VIEW_CONTENT","required":true,"description":"Check out this page for possible event types: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"price":"{toFloat(event.properties.price ?? event.properties.value ?? event.properties.revenue)}","brands":"{event.properties.brands}","success":"{toInt(event.properties.success) in (0, 1) ? toInt(event.properties.success) : null}","currency":"{event.properties.currency}","item_ids":"{event.properties.sku}","description":"{event.properties.description}","number_items":"{event.properties.quantity}","item_category":"{event.properties.category}","search_string":"{event.properties.search_string}","sign_up_method":"{event.properties.sign_up_method}","transaction_id":"{event.properties.orderId ?? event.properties.transactionId ?? event.properties.transaction_id}","client_dedup_id":"{event.uuid}","payment_info_available":"{toInt(event.properties.payment_info_available)}"},"required":false,"description":"Map of Snapchat event attributes and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}]},{"name":"Products Searched","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"Products Searched","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"SEARCH","required":true,"description":"Check out this page for possible event types: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"},{"key":"eventProperties","type":"dictionary","label":"Event parameters","secret":false,"default":{"price":"{toFloat(event.properties.price ?? event.properties.value ?? event.properties.revenue)}","brands":"{event.properties.brands}","success":"{toInt(event.properties.success) in (0, 1) ? toInt(event.properties.success) : null}","currency":"{event.properties.currency}","item_ids":"{event.properties.sku}","description":"{event.properties.description}","number_items":"{event.properties.quantity}","item_category":"{event.properties.category}","search_string":"{event.properties.search_string}","sign_up_method":"{event.properties.sign_up_method}","transaction_id":"{event.properties.orderId ?? event.properties.transactionId ?? event.properties.transaction_id}","client_dedup_id":"{event.uuid}","payment_info_available":"{toInt(event.properties.payment_info_available)}"},"required":false,"description":"Map of Snapchat event attributes and their values. Check out this page for more details: https://businesshelp.snapchat.com/s/article/pixel-direct-implementation"}]}]},{"id":"template-blank-site-destination","name":"New client-side destination","description":"New destination with complex event mapping. Works only with posthog-js when opt_in_site_apps is set to true.","code":"export async function onLoad({ inputs, posthog }) {\n    console.log('🦔 Loading (takes 1 sec)', { inputs })\n    // onEvent will not be called until this function resolves\n    await new Promise((resolve) => window.setTimeout(resolve, 1000))\n    console.log(\"🦔 Script loaded\")\n}\nexport function onEvent({ inputs, posthog }) {\n    console.log(`🦔 Sending event of type ${inputs.eventType}`, inputs.payload)\n    // fetch('url', { method: 'POST', body: JSON.stringify(inputs.payload) })\n}","code_language":"javascript","inputs_schema":[{"key":"name","type":"string","label":"Name","default":"Max","description":"What's your name?"},{"key":"userId","type":"string","label":"User ID","secret":false,"default":"{event.distinct_id}","required":true,"description":"User ID"},{"key":"additionalProperties","type":"json","label":"Additional properties","secret":false,"default":{"email":"{person.properties.email}","browser":"{event.properties.$browser}"},"required":true,"description":"Additional properties for the Exported Object."}],"type":"site_destination","status":"stable","category":["Custom","Analytics"],"free":true,"icon_url":"https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/builder_hog_01_955c082cad.png","filters":null,"masking":null,"mapping_templates":[{"name":"Aquisition","include_by_default":true,"use_all_events_by_default":null,"filters":{"events":[{"id":"$pageview","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"acquisition","required":true,"description":"The destination's event type"},{"key":"payload","type":"json","label":"Payload","secret":false,"default":{"event":"{event}","person":"{person}"},"required":true,"description":"Payload sent to the destination."}]},{"name":"Conversion","include_by_default":null,"use_all_events_by_default":null,"filters":{"events":[{"id":"$autocapture","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"conversion","required":true,"description":"The destination's event type"},{"key":"payload","type":"json","label":"Payload","secret":false,"default":{"event":"{event}","person":"{person}"},"required":true,"description":"Payload sent to the destination."}]},{"name":"Retention","include_by_default":null,"use_all_events_by_default":null,"filters":{"events":[{"id":"$pageleave","type":"events"}]},"inputs":null,"inputs_schema":[{"key":"eventType","type":"string","label":"Event Type","default":"retention","required":true,"description":"The destination's event type"},{"key":"payload","type":"json","label":"Payload","secret":false,"default":{"event":"{event}","person":"{person}"},"required":true,"description":"Payload sent to the destination."}]}]}]}