Answers for "google analytics kirby"

0

google analytics kirby

Yes, like this:

<?php if(!cookie::exists('accepted')) {
  cookie::set('accepted', 'true', 1440);
}
?>

This code checks if the cookie with the name “accepted” has already been set, if not, the cookie is set with the value “true” and a lifetime of 24 hours. For more options, see the docs.

You can check if the cookie has been set with

<?= cookie:get('accepted') ?>

Hope this helps.
Posted by: Guest on April-15-2020

Code answers related to "google analytics kirby"

Browse Popular Code Answers by Language