Klips: Connecting to Google Analytics

 

On July 1, 2023, Google Universal Analytics properties will stop processing data.
Your Google Universal Analytics Klips will no longer be updated with new data. To preserve a copy of your Universal Analytics data, download your raw (unmodelled) data sources (select a data source from your list of data sources and, on its details page, click "Download Data") or download your Klip data as CSV/Excel.
Google Universal Analytics has been replaced with Google Analytics 4. Please refer to Google's documentation and our resources page for more information on moving to and working with Google Analytics 4.

 

Visualize, discover, and act on your data with Klips and Klip dashboards.

Ready to get the most from your Google Analytics website data? Get started by setting up a connection between Klipfolio and your Google Analytics data and adding some data sources.

When you're finished adding Google Analytics data sources, you'll use them to power your custom Klips.

This article includes:

Connecting to your Google Analytics data

Here are a couple things to note about connecting Klipfolio to your Google Analytics data:

Your data is safe with us. The first time you connect your Google Analytics data to Klipfolio, you'll be prompted to sign in to Google Analytics and give permission to allow Klipfolio to securely access data within your Google Analytics account. We are serious about protecting your data privacy.

Managing your connections. By default, your connection name looks like this: yourname@Google <date and time created>. You can modify the default connection name when you create a new connection or from your list of connections, accessed by clicking your Account Name (located at the bottom of the left navigation sidebar) and selecting Account > Connected Accounts or by clicking the button in the left navigation sidebar and selecting Connections.

You can use and reuse the same account connection every time you connect to Google Analytics. If you have trouble accessing an existing connection, your OAuth token may have expired. If that happens to you, check out these troubleshooting tips.

Note: You can select a user account (email address) instead of a brand account from the list of options when you authenticate and connect.

How do I find my Google Analytics Profile ID?

If you choose to create a custom-built Google Analytics data source, you will need to enter your chosen website's Profile ID into a specific spot in the query.

To find your Profile ID in Google Analytics:

  1. Sign in to your Google Analytics account.
  2. On your account home page, select a website that you want to monitor.
  3. In the Reporting interface, copy the numerical ID after the letter 'p' in the URL. This is your Profile ID.

Note: Do not include the letter 'p'.

  1. Paste your Profile ID into the query in Klipfolio when needed (see example below).

Adding a Google Analytics pre-built data source

Our pre-built data sources focus on the most sought-after Google Analytics data. Either use them as complete solutions or as starting points for custom building.

To add a Google Analytics pre-built data source:

  1. Click the + beside Data Sources in the left navigation sidebar.

If you don’t see the option above, go to the bottom of the left navigation sidebar and click your Account Name > Data Sources > Create a New Data Source.

  1. On the Where is your data? page, select Google Analytics.
  2. Select a pre-built data source from the left section of the Choose a pre-built or custom connection page.
  3. If this is your first time connecting to Google Analytics:
    • Click Connect an account. Enter your Google Analytics login credentials and click Next. If prompted, click Allow Access to enable Klipfolio to securely access your Google Analytics data. Click Continue.
  4. If you have connected with Google Analytics before:
    • Select an existing connection (token) from the drop-down list and click Continue.
  5. Select options from the drop-down lists under Basic settings and click Get data or, if you want to modify the pre-built data request, click Switch to Custom settings.
    Note: If you switch back to the Basic settings page after making changes in the Custom settings page, your changes will not be saved.
  6. Ensure this is the data you’re looking for and, optionally, select the checkbox to Model your dataLearn more about modelling your data source.
  7. Click Continue.
  8. Name, choose refresh settings, and, optionally, share your data source.
  9. Click Save.

If you clicked Switch to Custom settings, in the Configure your data source page:

  1. At Mode, select Simple from the drop-down menu.
  2. At Multiple Pages, select Retrieve more than one page of results if you expect your data to exceed one page. Note that this option is limited to 10 pages of data.
  3. Enter your Profile ID.
  4. Optionally, select one or more Dimensions from the drop-down menu.
  5. Select one or more Metrics from the drop-down menu. Note: There is a limit of 10 metrics per data request.
  6. Select an appropriate Time Period from the drop-down menu.
  7. Click Get data.
  8. Ensure this is the data you’re looking for and, optionally, select the checkbox to Model your data. Learn more about modelling your data source.
  9. Click Continue.
  10. Name, choose refresh settings, and, optionally, share your data source.
  11. Click Save.

The data source is added to your account and is ready to use for custom Klips. You can see all your data sources in your Data Source Library, accessed by clicking Data Sources in the left navigation sidebar.

Adding a Google Analytics custom data source

Need a unique set of data? When our pre-built data sources don't include exactly what you're looking for, create your own custom data source. You can either use a pre-built data source query as a base or write your own queries from scratch.

Note that you have a couple of options when custom-building Google Analytics data sources:

  • Choose Simple Mode to build your query using drop-down menus. This method enables you to specify which dimensions, metrics, and time period you want to include in your Google Analytics data source. If you want to make additional adjustments to your Simple Mode query, you can import the query to Advanced Mode.
  • Choose Advanced Mode to build your query from scratch. If you want to retrieve data that includes segments or filters, use Advanced Mode. More about Google Analytics' API and sample queries.

To add a Google Analytics custom data source:

  1. Click the + beside Data Sources in the left navigation sidebar.

If you don’t see the option above, go to the bottom of the left navigation sidebar and click your Account Name > Data Sources > Create a New Data Source.

  1. On the Where is your data? page, select Google Analytics.
  2. On the Choose a pre-built or custom connection page, click Create a custom Google Analytics data source.
  3. If this is your first time connecting to Google Analytics:
    • Click Connect an account. Enter your Google Analytics login credentials and click Next. If prompted, click Allow Access to enable Klipfolio to securely access your Google Analytics data. Click Continue.
  4. If you have connected with Google Analytics before:
    • Select an existing connection (token) from the drop-down list and click Continue.
  5. On the Configure your data source page, at Mode, select Simple from the drop-down menu.
  6. At Multiple Pages, select Retrieve more than one page of results if you expect your data to exceed one page. Note that this option is limited to 10 pages of data.
  7. Enter your Profile ID.
  8. Optionally, select one or more Dimensions from the drop-down menu.
  9. Select one or more Metrics from the drop-down menu. Note: There is a limit of 10 metrics per data request.
  10. Select an appropriate Time Period from the drop-down menu.
  11. Click Get data.
  12. Ensure this is the data you’re looking for and, optionally, select the checkbox to Model your data. Learn more about modelling your data source.
  13. Click Continue.
  14. Name, choose refresh settings, and, optionally, share your data source.
  15. Click Save.

The data source is added to your account and is ready to use for custom Klips. You can see all your data sources in your Data Source Library, accessed by clicking Data Sources in the left navigation sidebar.

Custom building: About APIs and queries

Want to learn more about custom building? This section is for you. Klipfolio connects to hundreds of services in the cloud that have a REST API. If you take the time to learn your service’s API to create queries for the data you want, your possibilities are endless. Here’s a quick overview video on APIs and Klipfolio:

Klipfolio API's 101

If you need help using APIs, ask a data analyst or developer.

You can build a query using the Google Analytics Query Explorer and bring that query into Klipfolio. Or, you can get started in Simple Mode and import your query to Advanced Mode. Use the Google Analytics Query Explorer to build and test your queries before you use them to bring data into Klipfolio. 

Refer to the Google Analytics API Documentation to discover more data requests.

See the reference table below for API related information and sample queries.

API Documentation Google Analytics API Documentation
Account For API access, ensure that you have Read and Analyze permissions.
API Explorer Google Analytics Query Explorer
Authentication Method OAuth Token Authentication
Response Format CSV
Simple Mode Simple Mode provides an interface for writing a RESTful URL that retrieves data from your Google Analytics account.
Advanced Mode Advanced mode lets you write a RESTful URL by hand or using the Google Analytics Graph API Query Explorer. This method is intended for advanced users with knowledge of Google Analytics API.
Sample Query This is an example of a query URL you may see when using Advanced Mode:

https://www.googleapis.com/analytics/v3/data/ga?ids=ga:Your-Profile-ID&metrics=ga%3Ausers&start-date=2012-01-14&end-date=2012-01-21
For dimensions and metrics that
require additional input
Some dimensions and metrics require additional input. To resolve this issue, follow these steps:
1. Switch from Simple Mode to Advanced Mode.
2. Change the value (n) to 1
For example: ga:customVarName(n)
becomes: ga:customVarName1

More example queries to help you get started

For organic search landing page performance:

https://www.googleapis.com/analytics/v3/data/ga?ids=ga:<Your-Profile-Id>&metrics=ga:users,ga:sessions,ga:bounceRate,ga:goalCompletionsAll,ga:avgTimeOnPage&dimensions=ga:hostname,ga:landingPagePath,ga:channelGrouping&filters=ga%3AchannelGrouping%3D%3DOrganic%20Search%3Bga%3Asessions%3E20&start-date={date.add(-30).format()}&end-date={date.yesterday}&max-results=10000

For your website performance data:

https://www.googleapis.com/analytics/v3/data/ga?ids=ga:<Your-Profile-Id>&start-date={date.add(-730).format()}&end-date=today&metrics=ga:users,ga:newUsers,ga:percentNewSessions,ga:sessions,ga:bounces,ga:bounceRate,ga:sessionDuration,ga:avgSessionDuration,ga:pageviews,ga:pageviewsPerSession&dimensions=ga:date&sort=-ga:date

Note: You're allowed a maximum of 10 metrics per data request.

Next steps

Great! You've connected to your Google Analytics data and created one (or more) data sources. Now you're ready to use those data sources in custom Klips.

Want to learn more?

Check out these related Klipfolio Knowledge Base articles:

Check out these related Google Analytics and Google Ads articles:

Have more questions? Submit a request