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 can be undertaken by users with the following roles: OC Site Manager and OC System Administrator.

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

There are a few 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 first need to link your dashboard with Google Analytics, then authorize the dashboard to draw information from Google Analytics. Additionally, each subsite you have is a different source of data – you will need to repeat these steps in each site you want to use the Insights dashboard.

  1. Go to Google Cloud Console and log in with the same account that you used to set up Google Analytics.
  2. 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. To create a new project, select New Project from the project dropdown menu in the menu. Give the project a name that's descriptive of what you're trying to do, such as "public site analytics" or "Library subsite". 
  3. The new project will be added to the project dropdown menu – this may take a few minutes. Select it when it appears.

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

  1. Once you're in the project (whether a new one or the one you used for maps), select Enable APIs and Services.
    Insights_step_3.png
  2. In the API Library, search for Google Analytics Data API then select and Enable it.
    Insights_step_4.png
  3. Then, in the API Library, search for Google Analytics Admin API then select and Enable it.
    Insights_step_5.png
  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. Select External, then select Create.
  6. Enter the App information, including an App name and User support email. This email address should be the one you used to create the account. 
  7. Under Authorized domain, select Add Domain and enter "opencities.com", then enter a contact email address into the Developer contact information.
  8. Select Save and Continue, and again twice more under Scopes and Test users.
  9. Under the final screen titled Summary, scroll to the bottom and select Back to Dashboard.
  10. The app will be in testing status, so select Publish App > Confirm to push it to production.

With your app now in production, you need to get a Client ID and Client Secret for OpenCities.

Get a Client ID and Client Secret

  1. From the left-hand menu, select Credentials, and now you'll need to create an OAuth 2.0 Client ID, so select Create Credentials > OAuth client ID.
  2. From the Application type dropdown menu, select Web Application, then give your application a Name.
  3. Under Authorized redirect URIs, select Add URI. Then, go to your OpenCities site admin in a new browser window.
  4. From the main menu, go to More > Social Accounts and copy the URI from the Authorized Redirect Uri field under Google Services.
  5. Go back to your Google Cloud Console window, paste the URI into the URIs field, and select Create.
  6. A screen will pop up showing Your Client ID and Your Client Secret. Do not close this window before copying these into your admin.
  7. Use the copy icon next to the Your Client ID field to copy the ID, then go back to Social Accounts in your OpenCities admin and paste it into the Client ID field.
  8. Use the copy icon next to the Your Client Secret field to copy the client secret, then go back to Social Accounts in your OpenCities admin and paste it into the Client Secret field. Then, select Save

URI.png

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

Authorize the Insights dashboard to use Google Analytics data

setup_2.png

  1. From the main menu, go to More > Insights, then select Authorize. 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.
    verified.png
  2. This process authorizes your OpenCities site to collect data from your Google Analytics account. So, select See and download your Google Analytics data, then select Continue.
  3. Once this process is complete, you'll be taken back to the Insights dashboard, where you'll need to select a data source. From the Select data source dropdown menu, select the project you've created in Google Analytics.
    settings.png
  4. 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 dropdown menu.
  5. Select Save.

Check your Insights dashboard is collecting data by going to More > Insights and, after a few minutes, the cards should be populated with data. 

What else?

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