40

According to the Google Analytics "Creating a Report" guide, a required field for a request is the viewId:

A valid view ID for the viewId field.

Cool. So what is a viewId and where do I find it? I click on the viewId link and it says:

Unique View Id for retrieving Analytics data.

Umm. Ok. But what is it, and how do I find it for the report I want? It doesn't appear to be the same as "property ID". Come on Google, we need a little more to work with here.

John D.
  • 2,521
  • 3
  • 24
  • 45

4 Answers4

43

Following below steps to get View ID.

  1. Sign in to Google Analytics.
  2. Click Admin, and navigate to View.

enter image description here

  1. In the VIEW column, click View Settings.

enter image description here

  1. View ID places in Basic Settings

enter image description here

Long Nguyen
  • 9,898
  • 5
  • 53
  • 52
31

A property is where the data is collected (so hits to a property count toward your hit quota for that account). A view is where you look at the data, it displayed hits from the property. Hits displayed in view do not count towards your quota.

Use cases are that you can include/exclude/change the data in views by filters, and set different permissions for views (e.g. different departments should have access only to tracking for certain sub-directories, stuff like that). You can create up to 25 views with different settings per property.

You find the view id when you go to the admin section and look at the outer right column (which is labelled "views"). Select the view you want to query from the dropdown and go to "view settings", there you find the id. Or visit the query explorer while you are logged in to Google and select the view from the dropdown, this will also show the view id (and you can start testing queries right away).

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62
  • 3
    Nice! This is exactly what I needed. I would have never known that View ID was buried deep in the Analytics admin area. – John D. Apr 27 '16 at 19:11
  • 1
    Same here - took me for ever to just figure out whether the view ID was generic/fixed for a type of reporting or customized to my site. Now I know! – Georges Brisset May 04 '17 at 21:19
  • 1
    I actually spent 1 hour trying to figure out what is going on with the View ID. I kept thinking it is the same ID as the 'Service Account' email ID that was created. Thank you! – SajidSalim Jan 02 '18 at 14:09
8

This document describes the Google Analytics account structure, and should answer your question as to what a view is: https://support.google.com/analytics/answer/1009618

If you're even unsure of what ID to use with a particular GA API, you can use the account explorer to find out: https://ga-dev-tools.appspot.com/account-explorer/

Philip Walton
  • 29,693
  • 16
  • 60
  • 84
  • 1
    Still even with these two links, I can't seem to find what my "viewId" value should be... – John D. Apr 27 '16 at 19:08
  • 2
    The second link will show you your view ID as well as all your other account related IDs. Just type in the search field to find your account, and then look in the table below under the "View" column. – Philip Walton Apr 27 '16 at 20:04
  • 2
    Account explorer does not work for GA4 although the nightmare that is Google documentation will still point you there even in Q3 of 22 – Paula Livingstone Jul 09 '22 at 13:39
5

Only Universal Analytics property have VIEWID, GA4 has not. enter image description here

Trần Hữu Hiền
  • 872
  • 1
  • 9
  • 22