08 - Google Analytics
November 26, 2021
WARNING: This post is over a year old. Some of the information this contains may be outdated.
DISCLAIMER: Any 3rd-party services in these posts and in the config are only recommendations/suggestions. I am not affiliated with any of them.
Register the website on Google Analytics.
Get your tracking ID, go to config.php
and add your ID under the services
key.
<?php
return [
// ...
'services' => [
'analytics' => 'UA-XXXXX-Y',
],
// ...
];
You can set your tracking ID to an empty string if you want to disable analytics without completely removing the related code.
'analytics' => '',
The master template is designed to only include analytics in production. This is to avoid tracking page views while you are developing the site.
Comments are not enabled for this post.