Google Analytics

Goals

A Goals resource describes a goal for one of a user's profiles.

For a list of methods for this resource, see the end of this page.

Resource representations

JSON template for Analytics goal resource.

{
  "id": string,
  "kind": "analytics#goal",
  "selfLink": string,
  "accountId": string,
  "webPropertyId": string,
  "internalWebPropertyId": string,
  "profileId": string,
  "name": string,
  "value": float,
  "active": boolean,
  "type": string,
  "created": datetime,
  "updated": datetime,
  "parentLink": {
    "type": "analytics#profile",
    "href": string
  },
  "urlDestinationDetails": {
    "url": string,
    "caseSensitive": boolean,
    "matchType": string,
    "firstStepRequired": boolean,
    "steps": [
      {
        "number": integer,
        "name": string,
        "url": string
      }
    ]
  },
  "visitTimeOnSiteDetails": {
    "comparisonType": string,
    "comparisonValue": long
  },
  "visitNumPagesDetails": {
    "comparisonType": string,
    "comparisonValue": long
  },
  "eventDetails": {
    "useEventValue": boolean,
    "eventConditions": [
      {
        "type": string,
        "matchType": string,
        "expression": string,
        "comparisonType": string,
        "comparisonValue": long
      }
    ]
  }
}
Property name Value Description Notes
accountId string Account ID to which this goal belongs.
active boolean Determines whether this goal is active.
created datetime Time this goal was created.
eventDetails object Details for the goal of the type EVENT.
eventDetails.eventConditions[] list List of event conditions.
eventDetails.eventConditions[].comparisonType string Type of comparison.

Acceptable values are:
  • "EQUAL":
  • "GREATER_THAN":
  • "LESS_THAN":
eventDetails.eventConditions[].comparisonValue long Value used for this comparison.
eventDetails.eventConditions[].expression string Expression used for this match.
eventDetails.eventConditions[].matchType string Type of the match to be performed.

Acceptable values are:
  • "BEGINS_WITH":
  • "EXACT":
  • "REGEXP":
eventDetails.eventConditions[].type string Type of this event condition.

Acceptable values are:
  • "ACTION":
  • "CATEGORY":
  • "LABEL":
  • "VALUE":
eventDetails.useEventValue boolean Determines if the event value should be used as the value for this goal.
id string Goal ID.
internalWebPropertyId string Internal ID for the web property to which this goal belongs.
kind string Resource type for an Analytics goal.
name string Goal name.
parentLink.href string Link to the view (profile) to which this goal belongs.
parentLink.type string Value is "analytics#profile".
profileId string View (Profile) ID to which this goal belongs.
type string Goal type.

Acceptable values are:
  • "EVENT":
  • "URL_DESTINATION":
  • "VISIT_NUM_PAGES":
  • "VISIT_TIME_ON_SITE":
updated datetime Time this goal was last modified.
urlDestinationDetails object Details for the goal of the type URL_DESTINATION.
urlDestinationDetails.caseSensitive boolean Determines if the goal URL must exactly match the capitalization of visited URLs.
urlDestinationDetails.firstStepRequired boolean Determines if the first step in this goal is required.
urlDestinationDetails.matchType string Match type for the goal URL. 

Acceptable values are:
  • "EXACT":
  • "HEAD":
  • "REGEX":
urlDestinationDetails.steps[] list List of steps configured for this goal funnel.
urlDestinationDetails.steps[].name string Step name.
urlDestinationDetails.steps[].number integer Step number.
urlDestinationDetails.steps[].url string URL for this step.
urlDestinationDetails.url string URL for this goal.
value float Goal value.
visitNumPagesDetails object Details for the goal of the type VISIT_NUM_PAGES.
visitNumPagesDetails.comparisonType string Type of comparison.

Acceptable values are:
  • "EQUAL":
  • "GREATER_THAN":
  • "LESS_THAN":
visitNumPagesDetails.comparisonValue long Value used for this comparison.
visitTimeOnSiteDetails object Details for the goal of the type VISIT_TIME_ON_SITE.
visitTimeOnSiteDetails.comparisonType string Type of comparison.

Acceptable values are:
  • "GREATER_THAN":
  • "LESS_THAN":
visitTimeOnSiteDetails.comparisonValue long Value used for this comparison.
webPropertyId string Web property ID to which this goal belongs. The web property ID is of the form UA-XXXXX-YY.

Methods

get
Gets a goal to which the user has access.
insert
Create a new goal.
list
Lists goals to which the user has access.
patch
Updates an existing view (profile). This method supports patch semantics.
update
Updates an existing view (profile).

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.