GithubHelp home page GithubHelp logo

jersyfi / js-cookify Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 4.0 782 KB

Simple cookie consent manager with tracking possibility in pure javascript.

Home Page: https://cookify.jersyfi.dev/

License: MIT License

JavaScript 48.11% HTML 51.89%
bootstrap javascript vanilla-javascript vanilla-js vanillajs gdpr cookies cookie-consent consentcookie cookie-banner

js-cookify's Introduction

Hi, I'm J茅r么me 馃憢

Let's start with a bit of fun before getting into serious stuff. Are you better then me in beating the score of +0.04? Try it out here and Cherish the time.

If you liked my projects and would like me to spend more time on them, please feel free to support me on Ko-Fi.

ko-fi

What programming languages do i know?

const profile = [
    name = 'J茅r么me Bastian Winkel',
    languages = [
        'common' => [
            'PHP' => ['Laravel', 'Livewire'],
            'JavaScript' => ['TypeScript', 'Alpine.js', 'React', 'Next.js'],
            'CSS & HTML' => ['Bootstrap', 'Tailwind CSS']
        ],
        'uncommon' => [
            'Java', 'C', 'C++', 'C#'
        ]
     ]
]

GitHub Stats

Jersyfi's GitHub stats
Top Langs

js-cookify's People

Contributors

caschberg avatar jersyfi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

js-cookify's Issues

Check for removing actionCallback

Question:
Can the actionCallback be reduced by using the initCallback instead?

Notes
The initCallback can be called instead of the actionCallback in case of actions. More code need to be executed by calling initCallback but in my cases its not too much. This would reduce the initilization.

@caschberg do you have any feedback for me on this question? This would help to answer my question.

The module does not work on Microsoft Edge

Hello,

First of all: Great code and features. Congrats!

The issue: When Cookiefy is implemented in a website as described in the documentation it runs without problems on Chrome, Firefox and Opera, but does not work on Edge (Microsoft Edge 44.19041.423.0, Microsoft EdgeHTML 18.19041). No error is displayed. The cookie icon and the model do not appear.

Thank you in advance for your help.

Export Module

In order to export the module the class need to be exported.

grafik

Also remove the line of code where the variable cookify is created.

grafik

In the documentation a new lines of code need to be added in order to use the exported module.

grafik

Modal Button Elements

Inside the init function of view -> {modal} -> button a line of code is missing to delete the exisiting buttons from preset.

grafik

Dosent load script in Firefox

After page load in Firefox i have this in the DOM

<script data-c-script="marketing" type="text/javascript" src="https://integrations.etrusted.com/applications/widget.js/v2"></script> <script data-c-script="performance" type="text/javascript" src="https://www.google-analytics.com/plugins/ua/ecommerce.js"></script>

But its not loaded :( It works in Chorme and Edge. I have no errors in my console. The type="text/plain" is set correctly in the code. I have no idea... Has anyone an idea what i can try?

Option to save data not only in cookies

  • Evaluate where to save the data
    • Local/Session Storage
    • Cache or Filecache
  • Search for existing libraries or programm own code
  • Modify the functions getMemoryData() and setMemoryData()

@caschberg do you have any idears on my concept?

Support for scripts inside the HTML file.

@Jersyfi thank you for a great library. I like its simplicity. It works great with the external script:

<script type="text/plain" src="..." />

but for me it does not work with script inside the HTML (such as google analytics):

<script type="text/plain" cookify="analytics">
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', <GATAG>);
</script>

It changes type to "text/plain" and it sets src=null. From the source code, it looks like it is made only for the external script. I am asking if there is any option to handle scripts in the file too or should I move my Google Analytics snippet to a separate file?

Google Analytics scripts in the <head> tag

Hello,

First of all, thank you for providing this tool. It looks and works great.
The only important problem I have and I am trying to solve is concerning the requirement of Google Analytics remote source code. They say, I quote, "Copy and paste this code as the first item into the <HEAD> of every webpage you want to track." So I am placing the code right after <head> adding the data-c-script="statistics" as cookies category to the 2 <script> tags.

image

However, the Analytics code loads anyway because it is the first script in the head. Or I am missing something...

Setting of the 'support' flag doesn't work

When creating the cookify object, e.g. with
window.top.cookify = new Cookify({ 'support': false, ..., 'run': true });

doesn't work since its parsed incorrectly in cookify.js:

switch (type) {
        case 'name':
            this.initName(element, type);
            break;

        case 'expire':
            this.initExpire(element, type);
            break;

        case 'support':
            this.initExpire(element, type);
            break;
        ....

I think this should be

 case 'support':
     this.initSupport(element, type);
     break;

QUESTION: How can I trap the acceptance event?

Thanks for sharing your work!

I need to persist the agreement in a database, and so I wonder if you might be able to create a hook, or provide an example on how I could mount a listener, so I can act upon user action.

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.