jersyfi / js-cookify Goto Github PK
View Code? Open in Web Editor NEWSimple cookie consent manager with tracking possibility in pure javascript.
Home Page: https://cookify.jersyfi.dev/
License: MIT License
Simple cookie consent manager with tracking possibility in pure javascript.
Home Page: https://cookify.jersyfi.dev/
License: MIT License
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.
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.
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;
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.
However, the Analytics code loads anyway because it is the first script in the head. Or I am missing something...
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.
In the future cookies need to be secure so https is strict necessary.
For that the cookie need to be set as secure.
https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Set-Cookie/SameSite
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?
Question
What frameworks are needed?
Frameworks:
@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?
getMemoryData()
and setMemoryData()
@caschberg do you have any idears on my concept?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.