How do I connect Klipfolio and Google Analytics?

You can set up a connection between Klipfolio and your Google Analytics data to display your website metrics on a dashboard.

This article includes:

What options do I have for visualizing my Google Analytics data?

Create data visualizations based on pre-built options or build your own. The choice is yours!

Pre-built by Klipfolio

In collaboration with industry experts and adhering to current best practices and trends, Klipfolio focuses on getting the most out of your data and presenting it in meaningful, actionable visualizations. Our pre-built content, including pre-built data sources, pre-built Klips, and pre-built dashboards can act as a complete solution or as a starting point toward custom building.

 

  • Google Analytics pre-built data sources: Data sources provide the foundation for Klip building, so we suggest you create a data source as a first step (before building Klips and adding them to your dashboard). Our pre-built data sources focus on the most sought-after Google Analytics data and are found on the Service Connectors page, available from this link or from the Library. When you select a service connector from this page, the data source for that service is automatically added.

  • Google Analytics pre-built Klips: Pre-built Klips enable you to quickly set up a dashboard using predefined visualizations that display common key metrics. Pre-built Klips are found in the Klip Gallery or, for White Label customers, in the Integration Gallery.

  • Google Analytics pre-built dashboards: Pre-built dashboards provide an efficient and effective way to gather thematically-related Klips into a single, purposeful dashboard. Pre-built dashboards are found in the Dashboard Gallery.

Custom-built by you

Taking the time to learn how to create your own data sources and Klips unlocks your data and enables you to control, manipulate, and transform it, leading you to unprecedented insights into your business.

 

  • Custom data sources: When you create a custom data source, you can either use the pre-built data source as a starting point from which to write your own query or you can write your own queries from the ground up and build a data source from scratch. You create custom-built data sources in the Service Connectors page, accessible from this link or from the Library.

  • Custom Klips: Using our Klip Editor, you can construct and manipulate your data, including integrating multiple data sources, to produce unique, custom-built data visualizations. You create custom Klips from either your Library or your Dashboard.

 

Regardless of whether you choose pre-built, custom-built, or a combination of both, before you start building Klips and dashboards you need to connect to Google Analytics data in Klipfolio.

How do I connect to Google Analytics data in Klipfolio?

When you connect your Google Analytics data to Klipfolio, you will be prompted to connect your Google Analytics account by entering your username and password.

Doing so will create a token that enables Klipfolio to securely access your Google Analytics account. Your token looks like George@Google Analytics. You can use and reuse the same token every time you connect to Google Analytics.

Note: You manage your connections (tokens) to Google Analytics in Klipfolio under Connected Accounts in the Account section.

How do I find my 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 IDImportant: Do not include the letter 'p'. 

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

How do I add a Google Analytics pre-built data source?

To add a Google Analytics pre-built data source:

    1. Navigate to the Service Connectors page in Klipfolio and choose Google Analytics from the list.
    2. Select a pre-built data source from the left section of the Pick a Data Request 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 Next Step.
    4. If you have connected with Google Analytics before:
      • Select an existing connection (token) from the drop-down list and click Next Step.
    5. Select options from the list of Basic settings and click Get Data or, if you want to modify the pre-built data request, click to 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.

If you clicked Switch to Custom settings, in the Configure 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 more Dimensions from the menu.
  5. Select one or more Metrics from the 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.

How do I add Google Analytics pre-built Klips?

In the Klip Gallery you can browse individual Google Analytics pre-built Klips and add them to your dashboard. You replace the sample data that is included in pre-built Klips with your own Google Analytics data by clicking the menu in the Klip and selecting Connect your data.

How do I add Google Analytics pre-built dashboards?

In the Dashboard Gallery, you can browse and add pre-built Google Analytics dashboards. You replace the sample data that is included in pre-built dashboards with your own by clicking Connect Your Data at the top of the dashboard.

How do I create a Google Analytics custom-built data source?

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. For more information, refer to How do I create a Google Analytics data source from scratch?

To create a Google Analytics custom-built data source:

  1. Navigate to the Service Connectors page in Klipfolio and choose Google Analytics from the list.
  2. On the Pick a Data Request 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 Next Step.
  4. If you have connected with Google Analytics before:
    • Select an existing connection (token) from the drop-down list and click Next Step.
  5. On the Configure 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 menu.
  9. Select one or more Metrics from the 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.

If you want to edit a data source that you already created, check out How to edit or reconfigure a data source, and get step-by-step instructions.

How do I create a Google Analytics data source from scratch?

You can choose to build a data source from scratch. 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 and simple overview video on APIs and Klipfolio:

  Klipfolio API's 101

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

You can build a query using the Google Analytics Query Explorer and bring that query into Klipfolio. Or 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.

When you are happy with your query, click Get Data, and then save and name your new data source. You're now ready to use it to build a Google Analytics Klip.

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

Google Analytics quick reference table

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 / 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 get you 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

Important! You are allowed a limit of 10 metrics per data request.

How do I create a Google Analytics custom Klip?

You create custom Klips from either your Library or your Dashboard. You choose a data visualization format, for example, a pie chart, gauge, or table, and decide whether you want to use an existing data source or create a new one. In the Klip Editor, there are limitless opportunities to modify, relate, and display your data. See the following related articles for more information and get building!

More information

Related Links