Welcome to the OpenCities help centre. Search for what you're after, or browse the categories.
Can't find what you're looking for? Submit a support ticket and we'll be in touch.

Follow

Set Up the Insights Dashboard

avatar of OpenCities Product Team

OpenCities Product Team

Last updated

This task is for users with the OC Site Manager or OC System Administrator roles.

The Insights dashboard can be connected to a Google Analytics account to help you track your site's performance. Before you get started with your Insights dashboard, you will need to make sure your website is connected to Google Analytics and that you have a script for Google Analytics in Site Management.

Once you have connected your website to Google Analytics, there are a few additional steps to get the dashboard up and running:

You can also view your site metrics directly in your Google Analytics account.

This article is for users setting up their Insights Dashboard for the first time. If you have already set up the dashboard but want to switch the data source to a Google Analytics 4 property, please see Use Google Analytics 4 with the Insights Dashboard.

Create a Project in Google Cloud Console

Before you can use the Insights dashboard, you will need to link your dashboard with Google Analytics and authorize it to draw information from Google Analytics. Additionally, each subsite you have is a different source of data—you will need to repeat these steps on each site you want to use the Insights dashboard on.

  1. Go to Google Cloud Console and log in with the same account you used to set up Google Analytics. If you have already created a project for your maps, you can use the same one. Otherwise, you'll need to create a new project.
  2. Click Select a project in the header to choose your existing project from the list.
  3. Or, to create a new project, select New project.the select a project menu includes the project list and new project button
  4. Enter a Project name describing what you're trying to do, such as "public site analytics" or "Library subsite." The project name will also change the Project ID; you can Edit this now but cannot change it once the project is created.
  5. The Organization and Location fields should auto-fill, but change these if needed.
  6. Select Create.
    the new project fields and create button

Now, you need to enable two APIs and register an app for this project before you can link your site with Google Analytics.

Enable APIs and Register an App

Use the same Select a project menu to choose the correct project and:

  1. Use the Navigation menu to go to APIs & Services and select Enable APIs and services.
    the enable APIs and services button is in the APIs and services section
  2. In the API Library, search for Google Analytics Data API, then select and Enable it.
    the google analytics data API option in the API library
  3. Then, in the API Library, search for Google Analytics Admin API, select it, and enable it.
    the google analytics admin API option in the API library with the enable button
  4. Return to Enable APIs and Services to confirm these APIs appear in the list.
  5. Now, go back to the navigation menu and go to APIs & Services > OAuth consent screen and select Get started.
  6. Enter the App information, including an App name and User support email, and select Next. This email address should be the one you used to create the account. 
  7. Under Audience, select External, then select Next.
  8. Enter an email address in the Contact Information and select Next.
  9. Under Finish, check I agree to the Google API Services: User Data Policy and select Create.
  10. Go to Branding and, under Authorized domain, select Add domain and enter "opencities.com"
    the authorized domains are in the branding section of google auth platform
  11. Select Save and the app will be in testing status, so select Audience > Publish app > Confirm to push it to production.publish the app in the audience section of google auth platform

With your app in production, you must get a Client ID and Client Secret for the CMS.

Get a Client ID and Client Secret

  1. Use the navigation menu to go to APIs & Services > Credentials.
  2. Select Create credentials > OAuth client ID.
    the create credentials option is in the APIs and services section of Google cloud
  3. From the Application type drop-down menu, select Web Application, then give your application a Name.
    Use the application type dropdown menu to select web application
  4. Under Authorized redirect URIs, select Add URI. Then, go to your CMS site admin in a new browser window.
    add URIs in the authorized redirect URI section
  5. Go to More > Social Accounts and copy the URI from the Authorized Redirect Uri field under Google Services.
  6. Return to your Google Cloud Console window, paste the URI into the URIs field, and select Create.
  7. A screen will pop up showing Your Client ID and Your Client Secret. Do not close this window before copying these into your admin.
  8. Use the copy icon next to the Your Client ID field to copy the ID, then go back to Social Accounts in your admin and paste it into the Client ID field.
  9. Use the copy icon next to the Your Client Secret field to copy the client secret. Go back to Social Accounts in your admin and paste it into the Client Secret field.
  10. Select Save

the Google services client ID and client services fields in the open cities admin

You're almost done; you just need to authorize your Insights dashboard to gather data from Google Analytics.

Authorize the Insights Dashboard to Use Google Analytics Data

The Authorize button in the insights dashboard

  1. Go to More > Insights and select Authorize.
  2. Choose the email address associated with your Google Analytics account. You may see a message saying that Google hasn't verified the app. Select Advanced, then select Go to opencities.com.
    the verify app pop-up window
  3. This process authorizes your website to collect data from your Google Analytics account. So, select See and download your Google Analytics data, then select Continue. Once this process is complete, you'll be returned to the Insights dashboard, where you must choose a data source.
  4. Select the project you've created in Google Analytics from the Select data source drop-down menu.
    The insights dashboard settings, including the select data source dropdown menu
  5. Repeat steps 1-3 for each subsite on which you want to view the Insights dashboard, but remember to select the project for that subsite from the Select data source drop-down menu.
  6. Select Save.

Go to More> Insights to check if your Insights dashboard is collecting data. It may take some time for the cards to populate with data, depending on the amount of data available in your Google Analytics account.

What Else?

Was this article helpful?
1 out of 3 found this helpful