Use Google Analytics as a data source



This article is divided into two parts. PART ONE will guide you through creating a data source using Google Analytics (Simple Mode). PART TWO will guide you through creating a data source using Google Analytics (Advanced Mode).

Resources

Data Source Type Google Analytics
Authentication OAuth Token (Google Analytics)
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%3A{ProfileID}&metrics=ga%3Ausers&start-date=2012-01-14&end-date=2012-01-21
API Documentation Google Analytics API Docs
Account For API access, ensure that you have Read and Analyze permissions.
Simple Mode Simple mode provides an interface for crafting a RESTful URL that retrieves data from your Google Analytics account.
Advanced Mode Advanced mode lets you craft 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. (See below for more detailed instructions).
Video: Use Google Analytics as a data source
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
Klip Gallery

Save time and add pre-built Klips with the Klip Gallery!

Klip Gallery: Google Analytics

PART ONE

Step-by-Step

Creating a data source using Google Analytics (Simple Mode)

To create a data source using Google Analytics, you need to accomplish 3 tasks:

  • Start the data source creation process.
  • Retrieve your Google Analystics ID
  • Authenticate with Google Analytics using an OAuth Token.
  • Craft a query and enter it in Klipfolio.

Step 1: Start the data source creation process

  1. Click on the Library link.
  2. Select the Data Sources tab.
  3. Click the Create a New Data Source button.
  4. Select the Google Analytics option.

Step 2: Retrieve your Google Analytics ID

Each web property in your Google Analytics account has a unique profile name and profile ID. In order to retrieve data from a specific web property/website, you need to enter that profile ID into Klipfolio.

  1. Sign in to your Google Analytics account: click here.
  2. On your account home page, select a website that you want to monitor.
  3. In the Reporter interface, copy the numerical ID after the p in the URL. Important: Do not include the letter p in the ID. 
  4. Paste that ID into Klipfolio.

Step 3: Craft the query and enter it in Klipfolio

With Simple Mode, you can craft a query using the drop-down menus provided. This method allows you to specify dimensions, metrics, and time period to be retrieved; if you want to retrieve data such as segments, or apply filters to your data, you should use Advanced Mode.

  1. Optional: Select one or more Dimensions from the menu provided.
  2. Select one or more Metrics from the menu provided.
  3. Select an appropriate Time Period from the menu provided.
  4. Click the Get Data button.
  5. Save and name your data source.

Some metrics and dimensions require additional input before they will work. Check out the following article to learn how to resolve this issue: Google Analytics: Dimensions and metrics that require additional input

Klipfolio will return a spreadsheet with data from the specified fields.

PART TWO

Step-by-Step

Creating a data source using Google Analytics (Advanced Mode)

To create a data source using Google Analytics data, you need to accomplish 4 tasks:

  • Start the data source creation process
  • Use the Google Analytics API to craft a query
  • Enter the query in Klipfolio 
  • Use Klipfolio to adjust the query for your dashboard

Step 1: Start the data source creation process

  1. Click on the Library link.
  2. Select the Data Sources tab.
  3. Click the Set Up a New Data Source button.
  4. Select the Google Analytics option.
  5. Click the Create button.
  6. Authenticate using your Google Analytics credentials.

Step 2: Use the Google Analytics API to craft a query

In this section, you will work with the Google Analytics Data Feed Query Explorer to construct a URL.

  1. Navigate to the following URL in a new browser window or tab: http://ga-dev-tools.appspot.com/explorer/
  2. Click the Authenticate with Google Analytics button.
  3. Enter your credentials when prompted an click the Grant access button.
  4. Click on the words Click to list your accounts in the ids field.
  5. Select a website from the list of profile IDs you monitor.
  6. Click on the dropdown menu in the Metrics field.
  7. Select one or more Metrics to include in the API (for example: ga:visitors).

Step 3: Enter the query in Klipfolio

Now you'll need to bring the query you crafted with the Query Explorer into Klipfolio.

  1. In the Google Query explorer, select the Query URI button near the top of the window.
  2. Copy the URL to your clipboard.
  3. Return to Klipfolio.
  4. Paste the URL in the Query URI field using the Advanced Mode option.

Step 4: Use Klipfolio to adjust the query for your dashboard

Edit the query date ranges and save

Many Klips that use Google Analytics data need a date range that is dynamic (for example, past 30 days). In this section we're going to change the query from a fixed range to a dynamic one.

  1. Find start-date= in your Query URI.
  2. Delete the date that appears right after it. Note: Only delete the data that appears in yyyy-MM-dd format.
  3. Replace it with the following: {date.last30Days}
  4. Find end-date=and delete the date that follows it.
  5. Replace it with the following: {date.today}
  6. Click the Get Data button.
  7. Save and name your data source.

If your query returned an error, make sure it looks like this:

https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A{ProfileID}&metrics=ga%3Avisitors&start-date={date.last30Days}&end-date={date.today}

Common date range expressions:

AdWords

You can also link your Google Analytics account to your Adwords account in order to analyze web site traffic or sales driven by Adwords. Some useful metrics include impressions, click through rate, and ad costs. For more information, see Link Google Analytics and Adwords.

Related Links

Connecting to data sources

  1. Klipfolio Data Source Integrations
  2. Creating data sources
  3. Best practices for uploading your data
  4. Updating data sources
  5. About data source refresh
  6. Install the latest Google Analytics KlipStart Dashboard
  7. NEW: Install the latest Google AdWords KlipStart (for MCC accounts only)
  8. Guide to Web Accessible (REST API) data sources
  9. Authentication method: OAuth Token Authentication for Web Accessible Data Source
  10. Why does Klipfolio need specific permissions to connect my service accounts?
  11. Authentication method: 2 Step Authentication
  12. Authentication method: Basic HTTP Authentication
  13. Authentication method: API Key Authentication
  14. Managing OAuth tokens for connected accounts
  15. Use date range parameters to modify data retrieval period
  16. NEW: Signed Authentication Builder (Hash Helper) (advanced)
  17. Locate a data source ID
  18. SQL Databases
  19. Use files from your computer as a data source
  20. Use Email Attachments as a data source
  21. Use Excel spreadsheets as a data source
  22. NEW: Use Adobe Analytics as a data source
  23. NEW: Use Alexa as a data source
  24. Use Asana as a data source
  25. NEW: Use Atlassian JIRA as a data source
  26. NEW: Use AWeber as a Data Source
  27. NEW: Use Basecamp as a data source
  28. Use Bitly as a data source
  29. Use Box as a data source
  30. NEW: Use Buffer as a data source
  31. NEW: Use CallRail as a data source
  32. Use Campaign Monitor as a data source
  33. NEW: Use Chargify as a data source
  34. Use Cloud Monitor as a data source
  35. Use comScore Digital Analytix as a data source
  36. NEW: Use Desk.com as a data source
  37. Use Dropbox as a data source
  38. Use Eloqua as a data source
  39. Use Facebook as a data source
  40. NEW: Use Facebook Ads as a data source
  41. NEW: Use FluidSurveys as a data source
  42. Use Freshdesk as a data source
  43. NEW: Use Fusebill as a data source
  44. Use FTP or SFTP as a data source
  45. NEW: Use Glassdoor as a data source
  46. Use Google+ as a data source
  47. NEW: Use Google AdWords as a data source
  48. Use Google Analytics as a data source
  49. Use Google Analytics to create a Multi-Channel Funnel (MCF) API data source
  50. NEW: Use Google Calendar as a data source
  51. Use Google Drive Apps as a data source
  52. Use Google Webmaster Tools as a data source
  53. NEW: Use Harvest as a Data Source
  54. NEW: Use GoSquared as a data source
  55. Use Heartbeat as a Data Source
  56. NEW: Use HubSpot as a data source
  57. NEW: Use iFormBuilder as a data source
  58. PREVIOUS: Use iFormBuilder as a data source
  59. Use Infusionsoft as a data source
  60. NEW: Use Insightly as a data source
  61. NEW: Use Instagram as a data source
  62. NEW: Use Intercom as a data source
  63. Use Intervals as a data source
  64. NEW: Use Lighthouse as a Data Source
  65. Use LinkedIn as a data source
  66. Use Localytics as a data source
  67. Use MailChimp as a data source
  68. NEW: Use Mixpanel as a data source
  69. NEW: Use Marketo as a data source
  70. NEW: Use Moz as a data source
  71. NEW: Use New Relic as a data source
  72. Use Nicereply as a data source
  73. Use Optimizely as a data source
  74. NEW: Use Pardot as a data source
  75. Use Pingdom as a data source
  76. NEW: Use Pipedrive as a data source
  77. Use Podio as a data source
  78. NEW: Use QuickBooks as a data source
  79. Use QuickBooks with the Email Attachment Connector
  80. NEW: Use Quintly as a data source
  81. Use Radian6 as a data source
  82. NEW: Use RSS news feeds as a data source
  83. Use Salesforce as a data source
  84. Use Searchmetrics as a data source
  85. Use Sendible as a data source
  86. NEW: Use Shopify as a data source
  87. Use ShoreTelSky as a data source
  88. NEW: Use Slack as a data source
  89. Use Smartsheet as a data source
  90. NEW: Use Stripe as a data source
  91. Use SurveyGizmo as a data source
  92. NEW: Use Swrve as a data source
  93. Use Toggl as a data source
  94. NEW: Use Trello as a data source
  95. NEW: Use Taleo as a data source
  96. NEW: Use Talkwalker as a data source
  97. NEW: Use Todoist as a data source
  98. Use Topsy as a data source
  99. Use Twitter as a data source
  100. Use UserVoice as a data source
  101. NEW: Use VKontakte as a data source
  102. Use Webtrends as a data source
  103. NEW: Use Xero as a data source
  104. Use XMLA as a data source
  105. NEW: Use Yahoo Finance as a data source
  106. Use YouTube Analytics as a data source
  107. Use Zendesk as a data source
  108. Use Zoho CRM as a data source
  109. Automate data upload using the data source API
  110. Use Unbounce as a data source
  111. Data examples

Feedback and Knowledge Base