Goals

แหล่งข้อมูล เป้าหมาย จะอธิบายเป้าหมายสำหรับโปรไฟล์หนึ่งของผู้ใช้

ดูรายการวิธีการสำหรับแหล่งข้อมูลนี้ที่ส่วนท้ายของหน้านี้

การนำเสนอทรัพยากร

เทมเพลต JSON สำหรับทรัพยากรเป้าหมาย Analytics

{
  "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
      }
    ]
  }
}
ชื่อพร็อพเพอร์ตี้ ค่า คำอธิบาย Notes
accountId string รหัสบัญชีที่มีเป้าหมายนี้
active boolean กำหนดว่าเป้าหมายนี้ทำงานอยู่หรือไม่
created datetime เวลาที่สร้างเป้าหมายนี้
eventDetails object รายละเอียดสำหรับเป้าหมายประเภท EVENT
eventDetails.eventConditions[] list รายการเงื่อนไขเหตุการณ์
eventDetails.eventConditions[].comparisonType string ประเภทการเปรียบเทียบ ค่าที่เป็นไปได้คือ LESS_THAN, GREATER_THAN หรือ EQUAL
eventDetails.eventConditions[].comparisonValue long ค่าที่ใช้สำหรับการเปรียบเทียบนี้
eventDetails.eventConditions[].expression string นิพจน์ที่ใช้สำหรับการจับคู่นี้
eventDetails.eventConditions[].matchType string ประเภทของการจับคู่ที่จะดำเนินการ ค่าที่เป็นไปได้คือ REGEXP, BEGINS_WITH หรือ EXACT
eventDetails.eventConditions[].type string ประเภทของเงื่อนไขเหตุการณ์นี้ ค่าที่เป็นไปได้คือ CATEGORY, ACTION, LABEL หรือ VALUE
eventDetails.useEventValue boolean กำหนดว่าควรใช้มูลค่าของเหตุการณ์เป็นค่าสำหรับเป้าหมายนี้หรือไม่
id string รหัสเป้าหมาย
internalWebPropertyId string รหัสภายในของพร็อพเพอร์ตี้เว็บที่มีเป้าหมายนี้
kind string ประเภททรัพยากรสำหรับเป้าหมาย Analytics
name string ชื่อเป้าหมาย
parentLink.href string ลิงก์ไปยังข้อมูลพร็อพเพอร์ตี้ (โปรไฟล์) ที่มีเป้าหมายนี้อยู่
parentLink.type string ค่าคือ "analytics#profile"
profileId string ดูรหัส (โปรไฟล์) ของเป้าหมายนี้
type string ประเภทเป้าหมาย ค่าที่เป็นไปได้คือ URL_DESTINATION, VISIT_TIME_ON_SITE, VISIT_NUM_PAGES และ EVENT
updated datetime เวลาที่แก้ไขเป้าหมายนี้ครั้งล่าสุด
urlDestinationDetails object รายละเอียดสำหรับเป้าหมายประเภท URL_DESTINATION
urlDestinationDetails.caseSensitive boolean กำหนดว่า URL เป้าหมายต้องตรงกับการใช้อักษรตัวพิมพ์ใหญ่ของ URL ที่เข้าชมหรือไม่
urlDestinationDetails.firstStepRequired boolean กำหนดว่าต้องทำขั้นตอนแรกในเป้าหมายนี้หรือไม่
urlDestinationDetails.matchType string ประเภทการทำงานของคีย์เวิร์ดสำหรับ URL เป้าหมาย ค่าที่เป็นไปได้คือ HEAD, EXACT หรือ REGEX
urlDestinationDetails.steps[] list รายการขั้นตอนที่กำหนดค่าสำหรับช่องทางเป้าหมายนี้
urlDestinationDetails.steps[].name string ชื่อขั้นตอน
urlDestinationDetails.steps[].number integer หมายเลขขั้นตอน
urlDestinationDetails.steps[].url string URL สำหรับขั้นตอนนี้
urlDestinationDetails.url string URL สำหรับเป้าหมายนี้
value float มูลค่าเป้าหมาย
visitNumPagesDetails object รายละเอียดสำหรับเป้าหมายประเภท VISIT_NUM_PAGES
visitNumPagesDetails.comparisonType string ประเภทการเปรียบเทียบ ค่าที่เป็นไปได้คือ LESS_THAN, GREATER_THAN หรือ EQUAL
visitNumPagesDetails.comparisonValue long ค่าที่ใช้สำหรับการเปรียบเทียบนี้
visitTimeOnSiteDetails object รายละเอียดสำหรับเป้าหมายประเภท VISIT_TIME_ON_SITE
visitTimeOnSiteDetails.comparisonType string ประเภทการเปรียบเทียบ ค่าที่เป็นไปได้คือ LESS_THAN หรือ GREATER_THAN
visitTimeOnSiteDetails.comparisonValue long ค่าที่ใช้สำหรับการเปรียบเทียบนี้
webPropertyId string รหัสเว็บพร็อพเพอร์ตี้ที่มีเป้าหมายนี้ รหัสเว็บพร็อพเพอร์ตี้จะอยู่ในรูปแบบ UA-XXXXX-YY

วิธีการ

รับ
ได้รับเป้าหมายที่ผู้ใช้เข้าถึงได้
แทรก
สร้างเป้าหมายใหม่
list
แสดงรายการเป้าหมายที่ผู้ใช้เข้าถึงได้
แพตช์
อัปเดตเป้าหมายที่มีอยู่ เมธอดนี้รองรับความหมายของแพตช์
อัปเดต
อัปเดตเป้าหมายที่มีอยู่