syntro / silverstripe-google-analytics
Adds Google Analytics to your page
Installs: 85
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
Type:silverstripe-vendormodule
Requires
Requires (Dev)
- phpstan/phpstan-shim: ~0.11.0
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: ^3.0
- symbiote/silverstripe-phpstan: ^4
This package is auto-updated.
Last update: 2024-10-30 01:53:59 UTC
README
Adds Google Analytics to your Website. Uses syntro/silverstripe-klaro
for consent management.
Installation
To install this module, run the following command:
composer require syntro/silverstripe-google-analytics
Usage
After installing, you have to configure analytics to use your datastream:
Syntro\SilverstripeGoogleAnalytics\Config: google_token: G-XXXXXXXX
After that, Silverstripe will serve Google Analytics after the user has given consent.
Configuration
You can use the following options on Syntro\SilverstripeGoogleAnalytics\Config
to influence how the analytics script is loaded:
klaro_create_default_purpose
: if true, a new purpose will be createdklaro_purposes
: Add the created service to additional purposes. If 'klaro_create_default_purpose' is true, the 'analytics' purpose will be appended.klaro_enabled_by_default
: if true, the generated service will be enabled by default. WARNING: enabling this will most likely violate GDPR rules
Styling klaro!
This Module uses klaro! for consent management via the syntro/silverstripe-klaro
module. We recommend checking that module out for information on how to style the
consent-window.