Topics

Configuring Google analytics


In This Guide

To integrate Google Analytics with Brightspot, you must have a Google Analytics account and a Google API Service account, both of which generate values that you need to configure Brightspot.


Creating a Google Analytics account

  1. Create a Google Analytics account as described in Get started with Analytics.
  2. In your Google Analytics account, make the following settings:
    1. Tracking ID, for example UA-118898499-1
    2. View ID, for example 174965383

You'll be using these settings in the section Adding the Google Analytics integration.


Creating a Google API service account

  1. Create a service account on the Google APIs site https://console.developers.google.com/apis/credentials.
  2. Create credentials using a service account key that is a JSON key type. The key is downloaded as a JSON file. You'll use this file in the section Configuring a site to retrieve Google Analytics.
  3. Grant your Service Account access to read from the Google Analytics account.
    1. Go to https://analytics.google.com/analytics/web/ and log in.
    2. Go to Google Analytics > Admin > Property Access Management
    3. Click the (+) at the upper right corner of the screen to add a user.
    4. Copy the service account email generated by Google when you set up your service account.
    5. Paste the service account email and add the Read & Analyze permission.
    6. Click Add on the upper right corner to save the configuration.

Adding the Google Analytics Integration

To add the Google Analytics Integration to Brightspot:

  1. Click menu > Admin > Sites & Settings.
  2. In the Sites widget, select a site to integrate with Google Analytics, or select Global to integrate all your sites.
  3. Under Integrations, click add_circle_outline at the top of the page, and select Google Analytics from the list of choices.
  4. In the Tracking ID field, enter the tracking ID you assigned as described in the section Creating a Google Analytics account.

    The tracking ID generates a JavaScript snippet that is incorporated into your site pages. The snippet enables tracking of your site by Google Analytics.

  5. Toggle off Disabled.
  6. Click Save.

To configure your Brightspot site to retrieve Google Analytics information, see Configuring a site to retrieve Google Analytics.


Configuring a site to retrieve Google Analytics

To configure a Brightspot site to retrieve Google Analytics:

  1. Click menu > Admin > Sites & Settings.
  2. In the Sites widget, select a site to integrate with Google Analytics.
    Tip
    If you only have one set of credentials for your Google Analytics account, you can set those credentials under the Global site and they will cascade down to all of your other sites. The value in the Credentials field is the only value that cascades down to your other sites. You must still enter the View ID and remaining settings for each site that you want to retrieve Google Analytics.
  3. Under Integrations, scroll to, and expand, Google Analytics.
  4. Enter settings for the Google Analytics plugin.
    Google analytics integration
  5. Click Save.
  6. Change to the Global site.
  7. Click Integrations > Google.
  8. Verify that the Task Host field contains the name of the host running the import from Google Analytics.

Google Analytics settings—Integrations tab

Field
Description
Credentials

Private JSON key that was downloaded from the Google API service account as described in Creating a Google API service account. Copy the entire contents of the file into this field, including the opening and closing braces. You can set the Credentials at the Global site level and have that value cascade down to all of your other sites, or you can enter unique credentials for each site if you have per-site Google Analytics credentials. Credentials entered at the site level always supersede those entered at the Global level.

For example, you would use different credentials if your organization has different GCP Service Accounts with access to different GA Accounts/Views.

View IDID of the view that was generated in your Google Analytics account as described in Creating a Google Analytics account. You can configure your account to have multiple views, each with a different set of data.
Import Time ZoneSet the time zone for your data import. This setting must match the time zone of the same View as specified in the View ID field above.
Page ReportToggling on this setting allows the import of page views data, at the per-page level, from Google Analytics. In addition, the following features become available:
Site ReportsType of reports to generate about traffic to your site:
  • Device categories—Indicates types of devices visitors are using on your site.
  • Demographics—Provides gender and age brackets.
  • Referrals—Indicates how visitors arrive at your site, such as referral traffic from other sites or clicking links in search engines.
  • Visits—Provides general information about site visits, such as number of sessions, users, and session duration.
Custom Event Filter StrategyFilters to apply when importing from Google Analytics.
  • None—No import occurs.
  • All Except—Import all events except those you select from the Filters list.
  • Only—Imports only those events you select from the Filters list.

Each entry in the Filters list is an event category and associated event actions configured in your Google console. (The entries must match exactly what is configured in Google.)

Analytics Import Task ScheduleTimes at which you want to ingest data from Google Analytics.
  • None—No ingestion occurs.
  • Cron Expression—A cron expression specifying the times at which you want to ingest data. For example, entering 0 15,45 * * * ? * ingests analytics every hour at 15 and 45 after the hour. (A good utility for composing cron expressions is at freeformatter.com.)
  • Schedule Builder—A set of accordions for configuring the ingestion intervals. For more information, see Configuring analytics ingestion intervals with the schedule builder.

This setting is only available on the Global site.

Historical Days to ImportNumber of days' data to import from Google Analytics. The default value for this field is 30 (days). This setting is only available on the Global site.

Creating Analytics ingestion filters

In your Google Analytics console, you can configure the categories and actions for which Google accumulates counts. For example, you can configure a category Video with two events: Start (the visitor started watching the video) and Complete (the visitor viewed the entire video). For a detailed explanation of categories and events, see About Events.

Brightspot ingests analytics based on the categories and events you configure in the Google console. Depending on your Analytics configuration, that can be a substantial amount of data. You can use event filters to reduce the amount of data ingested, so you ingest only the data you actually use.

To create an Analytics ingestion filter:

  1. Menu > Admin > Sites & Settings > Global > Edit GlobalClick menu > Admin > Sites & Settings.
  2. In the Sites widget, select the site for which you want to configure an ingestion filter.
  3. Under Integrations > Google Analytics > Custom Event Filter Strategy, select one of the following:
    • None—No custom events ingested for this site. Skip to step 8.
    • All Except—Brightspot ingests all the analytics except those matching the filters you configure. Continue with the next step.
    • Only—Brightspot ingests analytics matching the filters you configure. Continue with the next step.
  4. Click add_circle_outline. A Simple Event Filter form appears.
  5. In the Event Category field, paste an event category from your Google console.
  6. In the Event Action list, paste one or more actions from your Google console that are associated with the category. (If you leave this field blank, Brightspot matches all the actions associated with the category.)
  7. Repeat steps 4–6 to create additional filters.
  8. Click Save.
Analytics ingestion filters

Referring to the previous illustration, Brightspot ingests Google Analytics counts for the following categories:

  • Visitors clicking on the Request Demo button in the main navigation.
  • Visitors clicking on the Save My Seat button in an asset's body text.

See also:


Configuring Analytics ingestion intervals with the schedule builder

If you selected Schedule Builder in the Import Schedule list, you can use the schedule builder to configure the times at which Brightspot ingests data from Google Analytics. Examples of intervals are the following:

  • Every hour.
  • Every 15 minutes.
  • Every Monday at midnight.
  • Every Sunday at 1:00 am and 1:00 pm.

The following illustration is an example of an ingestion scheduled to run every 15 minutes.

Schedule builder example

The following sections describe the options available for different time categories. (The examples use a 24-hour clock.)

Second

ValueDescriptionExample
NoneIngestion runs at the first second in a minute.Ingestion runs at 11:05:00.
At certain secondsIngestion runs when the time is at the specified seconds. Selecting 0 and 30 in this field means the ingestion runs at 11:05:00 and 11:05:30.
Between secondsIngestion runs at each second in the interval. Selecting start=0 and end=30 means the ingestion runs at 11:05:00, 11:05:01, 11:05:02, …, 11:05:30.
Every secondIngestion runs every second.Ingestion runs at 11:05:00, 11:05:01, 11:05:02, etc.
Every X secondsIngestion runs at the start second and then every x seconds thereafter.Selecting start=10 and selecting an interval of 20 means the ingestion runs at 11:05:10, 11:05:30, 11:05:50, 11:06:10, etc.

Minute

ValueDescriptionExample
NoneIngestion runs at the first minute of an hour.Ingestion runs at 11:00:00.
At certain minutesIngestion runs when the time is at the specified minutes. Selecting 0 and 30 in this field means the ingestion runs at 11:00:00 and 11:30:00.
Between minutesIngestion runs at each minute in the interval.Selecting start=0 and end=5 means the ingestion runs at 11:00:00, 11:01:00, 11:02:00, …, 11:05:00.
Every minuteIngestion runs every minute.Ingestion runs at 11:05:00, 11:06:00, 11:07:00, etc.
Every X minutesIngestion runs at the start minute and then every x minutes thereafter.Selecting start=10 and selecting an interval of 20 means the ingestion runs at 11:10:00, 11:30:00, 11:50:00, 12:10:00, etc.

Hour

ValueDescriptionExample
NoneIngestion runs every hour.Ingestion runs at 11:00:00, 12:00:00, 13:00:00, etc.
At certain hoursIngestion runs when the time is at the specified hours.Selecting 0 and 12 in this field means the ingestion runs at 00:00:00 and 12:00:00.
Between hoursIngestion runs at each hour in the interval.Selecting start=0 and end=5 means the ingestion at 00:00:00, 01:00:00, 02:00:00, …, 05:00:00.
Every hourIngestion runs every hour.Ingestion runs at 11:00:00, 12:00:00, 13:00:00, etc.
Every X hoursIngestion runs at the start hour and then every x hours thereafter.Selecting start=11 and selecting an interval of 5 means the ingestion runs at 11:00:00, 16:00:00, 21:00:00, 11:00:00 (the following day), etc.

Day

ValueDescriptionExample
NoneIngestion runs every day.Ingestion runs on Sunday, Monday, Tuesday, etc.
Every dayIngestion runs every day.Ingestion runs on Sunday, Monday, Tuesday, etc.
Every x days of monthIngestion runs at the start day of the month and then every x days thereafter.Selecting start=5 and end=10 means the ingestion runs June 5, June 15, June 25, July 5, etc.
Every x days of weekIngestion runs at the start day of the week and then every x days thereafter.Selecting start=Sunday and selecting an interval of 3 means the ingestion runs on Sunday, Wednesday, Saturday, Sunday, etc.
Last day of monthIngestion runs on last day of the month.Ingestion runs on January 31, February 28/29, March 31, etc.
Last weekday of monthIngestion runs on last weekday of the month.For the year 2022, ingestion runs on January 31 (Monday), February 28 (Monday), March 31 (Thursday), etc.
Last X of monthIngestion runs on the last selected day of the month.Selecting Thursday and for the year 2022, ingestion runs on January 27, February 24, March 31, etc.
Nearest weekday to Xth of monthIngestion runs on the nearest weekday before or after the selected day.Selecting 12 and for the year 2022, the ingestion runs on January 12 (Wednesday), February 11 (Friday), March 11 (Friday), etc.
On certain days of monthIngestion runs on selected numbered days.Selecting 1 and 15 means the ingestion runs on January 1 and 15, February 1 and 15, March 1 and 15, etc.
On certain days of weekIngestion runs on selected days of the week.Selecting Monday and Wednesday means the ingestion runs every Monday and Wednesday.
X days before end of monthIngestion runs on the number of days prior to end of the month.Selecting 3 and for the year 2022, the ingestion runs on January 28 (Friday), February 25 (Friday), March 28 (Monday), etc.
Xth day of week in monthIngestion runs on the specified day's occurrence in a month.Selecting 2 and Friday, and for the year 2022, the ingestion runs on January 14, February 11, March 11, etc.

Month

ValueDescriptionExample
NoneIngestion runs every month.Ingestion runs in January, February, March, etc.
Between monthsIngestion runs between the two specified months.Selecting start=January and end=June means the ingestion runs every month from January to June.
During certain monthsIngestion runs when the time is within the specified months.Selecting January and June in this field means the ingestion runs in January and June.
Every monthIngestion runs every month.Ingestion runs in January, February, March, etc.
Every X monthsIngestion runs in the start month and then every x months thereafter.Selecting start=3 and selecting an interval of 5 means the ingestion runs in March, August, December, March (the following year), etc.