ngiraud/laravel-cookies-analytics 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ngiraud/laravel-cookies-analytics

Composer 安装命令:

composer require ngiraud/laravel-cookies-analytics

包简介

Add Google Analytics and cookie consent to your application.

README 文档

README

Latest Version on Packagist Total Downloads

Installation

  • Install the package via composer:
composer require ngiraud/laravel-cookies-analytics
yarn add cookieconsent

or

npm install cookieconsent --save

Usage

  • You can activate/deactivate cookies and google analytics by settings environment variables in your .env file :
GOOGLE_ANALYTICS_ENABLED
GOOGLE_ANALYTICS_ID (mandatory if GOOGLE_ANALYTICS_ENABLED is set to true)
COOKIES_ENABLED
  • Add the view to the top of your <head> section :
@include('analytics::scripts')
  • Add the css for the CookieConsent plugin in your css file :
@import "../../node_modules/cookieconsent/build/cookieconsent.min.css";
  • And these lines in your vuejs index file :
import {CookieConsent} from 'cookieconsent';

if (window.cookieSettings.enabled === true) {
    document.addEventListener('DOMContentLoaded', () => {
        cookieconsent.initialise(window.cookieSettings.content);
    });
}
  • If you want to customize the popup and the message in the config file, you can publish and edit the config file :
php artisan vendor:publish --tag=analytics-config

Don't forget to generate and include your css & js files.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email contact@ngiraud.me instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 116
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-11-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固