Skip to content

Instantly share code, notes, and snippets.

View studiohypersetadmin's full-sized avatar

Studio Hyperset studiohypersetadmin

View GitHub Profile
@studiohypersetadmin
studiohypersetadmin / retargeting-anonymous-visitors.txt
Last active June 26, 2024 22:05
Retargeting Anonymous Visitors
<script>
// v.2
// Get URL Parameters
var urlParams = new URLSearchParams(window.location.search);
var paramsObject = {};
urlParams.forEach((value, key) => {
confection.submitEvent(key, value); // Submit each parameter as a separate event
paramsObject[key] = value;
});
confection.submitEvent("URLParametersAll", JSON.stringify(paramsObject)); // Submit all parameters as one event
@studiohypersetadmin
studiohypersetadmin / Confection Webflow Code
Last active August 20, 2021 17:59
Confection Webflow Code
<confection-generator
id="confection"
// 1. See https://dashboard.confection.io/my-keys
account="%%%ACCOUNT_ID%%%"
// 2. Until Confection gets consent from a user, it will only collect non-personally-identifying information.
// Confection allows users to collect, store, and distribute data in accordance with the data protection
// law of their choice. Privacy attribute values are:
// none (if you're managing compliance in a different way), gdpr, ccpa, and lgpd
privacy="%%%ACCOUNT_PRIVACY%%%"
// 3. Confection uses a compact, minimally-invasive banner to get user consent.
cloudflare.com/cdn-cgi/bm/cv/669835187/api.js
static.cloudflareinsights.com/beacon.min.js
tr.www.cloudflare.com/gtm.js
tr.www.cloudflare.com/cdn-cgi/bm/cv/669835187/api.js
dash.cloudflare.com/cdn-cgi/bm/cv/669835187/api.js
@studiohypersetadmin
studiohypersetadmin / Confection Cloudflare Worker
Last active July 16, 2021 23:55
Confection Cloudflare Worker
addEventListener("fetch", event => {
event.respondWith(
handleRequest(event.request).catch(
err => new Response(err.stack, { status: 500 }),
),
)
})
/**
* @param {Request} request
{
"related_to": {
"id": 6461,
"created_time": 1599500949,
"email": "get@confection.io",
"ip": "73.158.94.118",
"browser": "Chrome 84.0 MacOSX Desktop",
"confetti": {
"email": "get@confection.io",
"lastname": "Confection",