Home » GInsights plugin » GInsights Documentation/Installation

GInsights Plugin Documentation & Installation

Ginsights is a Statamic plugin that provides an insight into Google Analytics data within the statamic dashboard. The plugin is easy to install in a website that is running a Statamic content management system.

The plugin integrates itself to the dashboard, where the user can review the traffic on various reports. 

  1. Session and Pageviews
  2. Top Devices
  3. New Vs. Returning Visitors
  4. Most Visited Pages
  5. Top Referrals

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 vijaysoftware/ginsights

Add the widgets to config/statamic/cp.php

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

Authenticate Google Analytics with GInsights

After installing the GInsights plugin a widget will be displayed on the statamic dashboard, Click on the “Click here” button to authorize your analytics account.

ginsights1

You will now be taken to a screen that will let you pick which Google Account you want to sign in with. Make sure to sign in to the account that you used to make your Google Analytics property.

ginsights-acclogin

Next, click the Allow button to give GInsights access to your Google Analytics data.

auth3

In the dropdown, find your website and then click on  Submit button to view Analytics data.

property_id

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 either in the header or footer as given below:

   {{ ginsightsgtag }}
Now the GA tracking code will automatically get inserted into the Statamic webpage.

GInsights Screenshots

Frequently Asked Questions

GInsights Analytics

  • Can I run GInsights together with another Google Analytics plugin?

    It is not recommended, using another Google Analytics plugin together with GInsights can interfere with tracking and skew your data.

    We recommend uninstalling other Google Analytics plugins before you install GInsights.

  • Will GInsights slow down my site?

    No. Only very specific tracking is loaded where needed while visitors are browsing your site, and this helps keep our script size as optimized as possible.

    We load the Google Analytics script directly from Google, since it’s used on millions of sites. This means the script is most likely already cached in your visitors’ browsers.

    When you’re logged into your Statamic admin, and looking at reports, GInsights is built using a modern JavaScript framework that makes it fast to load async without using up a lot of resources.

  • Why is the tracking code loaded in the head section of the site?

    This allows for other Google Analytics plugins and our addons to track things like downloads and eCommerce transactions, by ensuring that the Google Analytics script is loaded before anything else tries to use it. As it is an asynchronous Javascript snippet, it does not slow down the speed of your site loading.