Code Monkey home page Code Monkey logo

uzairbangee / confection-web-component Goto Github PK

View Code? Open in Web Editor NEW

This project forked from studiohyperset/confection-web-component

0.0 0.0 0.0 272 KB

Confection collects, stores, and distributes data in a way that's unaffected by client-side disruptions involving cookies, cross-domain scripts, and device IDs. It's also compliant with global privacy laws so it’s good for people too. And it integrates with the apps businesses and developers already use. There’s no need to switch systems.

Home Page: https://confection.io/quick-start/wss/

JavaScript 100.00%

confection-web-component's Introduction

About

Confection collects, stores, and distributes data in a way that's unaffected by client-side disruptions involving cookies, cross-domain scripts, and device IDs. It's also compliant with global privacy laws so it’s good for people too. And it integrates with the apps businesses and developers already use. There’s no need to switch systems. Just plug in, power up, and keep your marketing partnerships running strong.

This script helps Confection customers add Confection to their sites.

Need help getting started? See confection.io/quick-start/wss Need an account? Set one up @ dashboard.confection.io/register (It's free.)

Usage

Add the script to the any webpage.

 <script id="0000-000" src="./confection-generator.js" defer></script>

Add the script tag element to your page and set attribute values for confection settings.

The first 4 digits are for your account id value, found on your confection dashboard. The last 3 digits are configuration values.

  • The first position is the privacy type setting.

  • The second tells the confection component where to render, left center or right.

  • The third position enables or disables analytics.

For instance if your account id is 1234 and you want options to be privacy type GDPR and your banner to be centered and analytics enabled. Your script id would look like this.

id="1234-111"

Option values are found below.

Options

Valid values for confection settings are as follows:

  • Your account ID can be found found in your Confection account dashboard.
  • 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 = 0
    • gdpr = 1
    • ccpa = 2
    • lgpd = 3
  • Confection uses a compact, minimally-invasive banner to get user consent. Unlike other consent banners, ours only appears when necessary. Position attribute values are:

    • left = 0
    • center = 1
    • right = 2
  • Analytics

    • false = 0
    • true = 1

Events

Add event listners to page to get the global values.

<script>
    window.addEventListener("ConfectionUuidGenerated", function(e){
        console.log(e.detail.uuid)
    });

    window.addEventListener("ConfectionAccountId", function(e){
        console.log(e.detail.account)
    });

    window.addEventListener("ConfectionPrivacy", function(e){
        console.log(e.detail.privacy)
    });

    window.addEventListener("ConfectionAnalytics", function(e){
        console.log(e.detail.analytics)
    });

    window.addEventListener("ConfectionPosition", function(e){
        console.log(e.detail.position)
    });
</script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.