fbpx

How to Install

Installation is simple. You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

BASH
composer require analytics/gaddon

Add the widgets to config/statamic/cp.php

PHP
[
    'type' => 'dashboard',
    'days' => 30
    'width' => 100,
],

Inserting GA Tracking code

The analytics tracking code for the selected property will be appended to the pages if you paste the tag to the template file as shown below:

<head>
   {{ gatag }}
</head>
It is recommended to place this in the document you have designated to house the <head>. The default location is:  /resources/views/layout.antlers.html
Now the GA tracking code will automatically get inserted into the Statamic webpage.

Inserting GA Tracking code into GInsights Configuration

You will need to retrieve your tracking code from the Google Analytics Console: https://analytics.google.com/

Once logged into  your GA property, select the Gear icon in the bottom left.

retreive_Ga_trackign_code
Top