Google Analytics API
  1. management
Google Analytics API
  • data
    • /data/ga
    • /data/mcf
    • /data/realtime
  • management
    • /management/accountSummaries
      GET
    • /management/accounts
      GET
    • /management/accounts/{accountId}/entityUserLinks
      GET
    • /management/accounts/{accountId}/entityUserLinks
      POST
    • /management/accounts/{accountId}/entityUserLinks/{linkId}
      DELETE
    • /management/accounts/{accountId}/entityUserLinks/{linkId}
      PUT
    • /management/accounts/{accountId}/filters
      GET
    • /management/accounts/{accountId}/filters
      POST
    • /management/accounts/{accountId}/filters/{filterId}
      DELETE
    • /management/accounts/{accountId}/filters/{filterId}
      GET
    • /management/accounts/{accountId}/filters/{filterId}
      PATCH
    • /management/accounts/{accountId}/filters/{filterId}
      PUT
    • /management/accounts/{accountId}/webproperties
      GET
    • /management/accounts/{accountId}/webproperties
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}
      PUT
    • /management/clientId:hashClientId
      POST
    • /management/segments
      GET
  • metadata
    • /metadata/{reportType}/columns
  • provisioning
    • /provisioning/createAccountTicket
    • /provisioning/createAccountTree
  • userDeletion
    • /userDeletion/userDeletionRequests:upsert
  1. management

/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals

POST
/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals
management
Create a new goal.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://analytics.googleapis.com/analytics/v3/management/accounts//webproperties//profiles//goals' \
--header 'Content-Type: application/json' \
--data-raw '{
    "accountId": "string",
    "active": true,
    "created": "2019-08-24T14:15:22Z",
    "eventDetails": {
        "eventConditions": [
            {
                "comparisonType": "string",
                "comparisonValue": "string",
                "expression": "string",
                "matchType": "string",
                "type": "string"
            }
        ],
        "useEventValue": true
    },
    "id": "string",
    "internalWebPropertyId": "string",
    "kind": "analytics#goal",
    "name": "string",
    "parentLink": {
        "href": "string",
        "type": "analytics#profile"
    },
    "profileId": "string",
    "selfLink": "string",
    "type": "string",
    "updated": "2019-08-24T14:15:22Z",
    "urlDestinationDetails": {
        "caseSensitive": true,
        "firstStepRequired": true,
        "matchType": "string",
        "steps": [
            {
                "name": "string",
                "number": 0,
                "url": "string"
            }
        ],
        "url": "string"
    },
    "value": 0,
    "visitNumPagesDetails": {
        "comparisonType": "string",
        "comparisonValue": "string"
    },
    "visitTimeOnSiteDetails": {
        "comparisonType": "string",
        "comparisonValue": "string"
    },
    "webPropertyId": "string"
}'
Response Response Example
{
  "accountId": "string",
  "active": true,
  "created": "2019-08-24T14:15:22Z",
  "eventDetails": {
    "eventConditions": [
      {
        "comparisonType": "string",
        "comparisonValue": "string",
        "expression": "string",
        "matchType": "string",
        "type": "string"
      }
    ],
    "useEventValue": true
  },
  "id": "string",
  "internalWebPropertyId": "string",
  "kind": "analytics#goal",
  "name": "string",
  "parentLink": {
    "href": "string",
    "type": "analytics#profile"
  },
  "profileId": "string",
  "selfLink": "string",
  "type": "string",
  "updated": "2019-08-24T14:15:22Z",
  "urlDestinationDetails": {
    "caseSensitive": true,
    "firstStepRequired": true,
    "matchType": "string",
    "steps": [
      {
        "name": "string",
        "number": 0,
        "url": "string"
      }
    ],
    "url": "string"
  },
  "value": 0,
  "visitNumPagesDetails": {
    "comparisonType": "string",
    "comparisonValue": "string"
  },
  "visitTimeOnSiteDetails": {
    "comparisonType": "string",
    "comparisonValue": "string"
  },
  "webPropertyId": "string"
}

Request

Path Params
accountId
string 
required
Account ID to create the goal for.
webPropertyId
string 
required
Web property ID to create the goal for.
profileId
string 
required
View (Profile) ID to create the goal for.
Body Params application/json
JSON template for Analytics goal resource.
accountId
string 
optional
Account ID to which this goal belongs.
active
boolean 
optional
Determines whether this goal is active.
created
string <date-time>
optional
Time this goal was created.
eventDetails
object 
optional
Details for the goal of the type EVENT.
eventConditions
array [object {5}] 
optional
List of event conditions.
useEventValue
boolean 
optional
Determines if the event value should be used as the value for this goal.
id
string 
optional
Goal ID.
internalWebPropertyId
string 
optional
Internal ID for the web property to which this goal belongs.
kind
string 
optional
Resource type for an Analytics goal.
Default:
analytics#goal
name
string 
optional
Goal name.
parentLink
object 
optional
Parent link for a goal. Points to the view (profile) to which this goal belongs.
href
string 
optional
Link to the view (profile) to which this goal belongs.
type
string 
optional
Value is "analytics#profile".
Default:
analytics#profile
profileId
string 
optional
View (Profile) ID to which this goal belongs.
selfLink
string 
optional
Link for this goal.
type
string 
optional
Goal type. Possible values are URL_DESTINATION, VISIT_TIME_ON_SITE, VISIT_NUM_PAGES, AND EVENT.
updated
string <date-time>
optional
Time this goal was last modified.
urlDestinationDetails
object 
optional
Details for the goal of the type URL_DESTINATION.
caseSensitive
boolean 
optional
Determines if the goal URL must exactly match the capitalization of visited URLs.
firstStepRequired
boolean 
optional
Determines if the first step in this goal is required.
matchType
string 
optional
Match type for the goal URL. Possible values are HEAD, EXACT, or REGEX.
steps
array [object {3}] 
optional
List of steps configured for this goal funnel.
url
string 
optional
URL for this goal.
value
number <float>
optional
Goal value.
visitNumPagesDetails
object 
optional
Details for the goal of the type VISIT_NUM_PAGES.
comparisonType
string 
optional
Type of comparison. Possible values are LESS_THAN, GREATER_THAN, or EQUAL.
comparisonValue
string <int64>
optional
Value used for this comparison.
visitTimeOnSiteDetails
object 
optional
Details for the goal of the type VISIT_TIME_ON_SITE.
comparisonType
string 
optional
Type of comparison. Possible values are LESS_THAN or GREATER_THAN.
comparisonValue
string <int64>
optional
Value used for this comparison.
webPropertyId
string 
optional
Web property ID to which this goal belongs. The web property ID is of the form UA-XXXXX-YY.
Examples

Responses

🟢200Successful response
application/json
Body
JSON template for Analytics goal resource.
accountId
string 
optional
Account ID to which this goal belongs.
active
boolean 
optional
Determines whether this goal is active.
created
string <date-time>
optional
Time this goal was created.
eventDetails
object 
optional
Details for the goal of the type EVENT.
eventConditions
array [object {5}] 
optional
List of event conditions.
useEventValue
boolean 
optional
Determines if the event value should be used as the value for this goal.
id
string 
optional
Goal ID.
internalWebPropertyId
string 
optional
Internal ID for the web property to which this goal belongs.
kind
string 
optional
Resource type for an Analytics goal.
Default:
analytics#goal
name
string 
optional
Goal name.
parentLink
object 
optional
Parent link for a goal. Points to the view (profile) to which this goal belongs.
href
string 
optional
Link to the view (profile) to which this goal belongs.
type
string 
optional
Value is "analytics#profile".
Default:
analytics#profile
profileId
string 
optional
View (Profile) ID to which this goal belongs.
selfLink
string 
optional
Link for this goal.
type
string 
optional
Goal type. Possible values are URL_DESTINATION, VISIT_TIME_ON_SITE, VISIT_NUM_PAGES, AND EVENT.
updated
string <date-time>
optional
Time this goal was last modified.
urlDestinationDetails
object 
optional
Details for the goal of the type URL_DESTINATION.
caseSensitive
boolean 
optional
Determines if the goal URL must exactly match the capitalization of visited URLs.
firstStepRequired
boolean 
optional
Determines if the first step in this goal is required.
matchType
string 
optional
Match type for the goal URL. Possible values are HEAD, EXACT, or REGEX.
steps
array [object {3}] 
optional
List of steps configured for this goal funnel.
url
string 
optional
URL for this goal.
value
number <float>
optional
Goal value.
visitNumPagesDetails
object 
optional
Details for the goal of the type VISIT_NUM_PAGES.
comparisonType
string 
optional
Type of comparison. Possible values are LESS_THAN, GREATER_THAN, or EQUAL.
comparisonValue
string <int64>
optional
Value used for this comparison.
visitTimeOnSiteDetails
object 
optional
Details for the goal of the type VISIT_TIME_ON_SITE.
comparisonType
string 
optional
Type of comparison. Possible values are LESS_THAN or GREATER_THAN.
comparisonValue
string <int64>
optional
Value used for this comparison.
webPropertyId
string 
optional
Web property ID to which this goal belongs. The web property ID is of the form UA-XXXXX-YY.
Modified at 2023-08-15 05:39:07
Previous
/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals
Next
/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}
Built with