Web 事件标签

GET accounts/:account_id/web_event_tags

检索与当前账号关联的部分或所有 Web 事件标签的详细信息。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/web_event_tags

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

count
可选

指定每个不同请求尝试检索的记录数量。

类型:int

默认值:200
最小值、最大值:11000
cursor
可选

指定光标以获取下一页结果。参阅分页了解更多信息。

类型:string

示例:8x7v00oow

sort_by
可选

根据支持的属性,按升序或降序排序。参阅排序了解更多信息。

类型:string

示例:created_at-asc

web_event_tag_ids
可选

通过指定以逗号分隔的标识符列表,将响应范围限定为所需的 Web 事件标签。最多可提供 200 个 ID。

类型:string

示例:o3bk1

with_deleted
可选

在请求中包含已删除的结果。

类型:boolean

默认值:false
可能值:truefalse
with_total_count
可选

包含 total_count 响应属性。

注意:不包含此参数和 cursor

注意:包含 total_count 的请求速率限制较低,目前设置为每 15 分钟 200 次。

类型:boolean

默认值:false
可能值:truefalse

请求示例

GET https://ads-api.twitter.com/10/accounts/18ce54d4x5t/web_event_tags?web_event_tag_ids=o3bk1

响应示例

{
  "request": {
    "params": {
      "web_event_tag_ids": [
        "o3bk1"
      ],
      "account_id": "18ce54d4x5t"
    }
  },
  "next_cursor": null,
  "data": [
    {
      "name": "web event tag",
      "view_through_window": 7,
      "click_window": 7,
      "embed_code": "<script src='"//platform.twitter.com/oct.js"' type='"text/javascript"'></script><script type='"text/javascript"'>twttr.conversion.trackPid('ny3od',  { tw_sale_amount: 0, tw_order_quantity: 0 });</script><noscript><img alt='""' height='"1"' src='"https://analytics.twitter.com/i/adsct?txn_id=ny3od&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0"' style='"display:none;"' width='"1"'/><img alt='""' height='"1"' src='"//t.co/i/adsct?txn_id=ny3od&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0"' style='"display:none;"' width='"1"'/></noscript>",
      "id": "o3bk1",
      "retargeting_enabled": false,
      "status": "UNVERIFIED",
      "type": "SITE_VISIT",
      "website_tag_id": "ny3od",
      "deleted": false
    }
  ]
}

GET accounts/:account_id/web_event_tags/:web_event_tag_id

检索与当前账号关联的特定 Web 事件标签。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/web_event_tags/:web_event_tag_id

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

web_event_tag_id
必需

请求中对正在操作的 Web 事件标签的引用。

类型:string

示例:o3bk1

with_deleted
可选

在请求中包含已删除的结果。

类型:boolean

默认值:false
可能值:truefalse

请求示例

GET https://ads-api.twitter.com/10/accounts/18ce54d4x5t/web_event_tags/o3bk1

响应示例

{
  "request": {
    "params": {
      "web_event_tag_id": "o3bk1",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "name": "web event tag",
    "view_through_window": 7,
    "click_window": 7,
    "embed_code": "<script src='"//platform.twitter.com/oct.js"' type='"text/javascript"'></script><script type='"text/javascript"'>twttr.conversion.trackPid('ny3od',  { tw_sale_amount: 0, tw_order_quantity: 0 });</script><noscript><img alt='""' height='"1"' src='"https://analytics.twitter.com/i/adsct?txn_id=ny3od&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0"' style='"display:none;"' width='"1"'/><img alt='""' height='"1"' src='"//t.co/i/adsct?txn_id=ny3od&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0"' style='"display:none;"' width='"1"'/></noscript>",
    "id": "o3bk1",
    "retargeting_enabled": false,
    "status": "UNVERIFIED",
    "type": "SITE_VISIT",
    "website_tag_id": "ny3od",
    "deleted": false
  }
}

POST accounts/:account_id/web_event_tags

创建与当前账号关联的新 Web 事件标签。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/web_event_tags

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

click_window
必需

此 Web 标签的点击窗口。

注意:仅接受如下所列的可能值。

类型:int

可能值:1714306090

name
必需

Web 标签的名称。

类型:string

示例:Sample single conversion event

retargeting_enabled
必需

指示是否应为此 Web 标签启用重定位。

类型:boolean

可能值:truefalse

type
必需

Web 标签的类型。

类型:enum

可能值:CUSTOMDOWNLOADPURCHASESIGN_UPSITE_VISIT

view_through_window
必需

通过窗口查看此 Web 标签。该值必须始终小于或等于 click_window 值。

注意:仅接受如下所列的可能值。

类型:int

可能值:01714306090

请求示例

POST https://ads-api.twitter.com/10/accounts/18ce54d4x5t/web_event_tags?click_window=7&name=web event tag&retargeting_enabled=false&type=SITE_VISIT&view_through_window=7

响应示例

{
  "data": {
    "name": "web event tag",
    "view_through_window": 7,
    "click_window": 7,
    "embed_code": "<script src='"//platform.twitter.com/oct.js"' type='"text/javascript"'></script><script type='"text/javascript"'>twttr.conversion.trackPid('ny3od',  { tw_sale_amount: 0, tw_order_quantity: 0 });</script><noscript><img alt='""' height='"1"' src='"https://analytics.twitter.com/i/adsct?txn_id=ny3od&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0"' style='"display:none;"' width='"1"'/><img alt='""' height='"1"' src='"//t.co/i/adsct?txn_id=ny3od&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0"' style='"display:none;"' width='"1"'/></noscript>",
    "id": "o3bk1",
    "retargeting_enabled": false,
    "status": "UNVERIFIED",
    "type": "SITE_VISIT",
    "website_tag_id": "ny3od",
    "deleted": false
  },
  "request": {
    "params": {
      "name": "web event tag",
      "view_through_window": 7,
      "click_window": 7,
      "retargeting_enabled": false,
      "account_id": "18ce54d4x5t",
      "type": "SITE_VISIT"
    }
  }
}

PUT accounts/:account_id/web_event_tags/:web_event_tag_id

更新与当前账号关联的 Web 事件标签。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/web_event_tags/:web_event_tag_id

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

web_event_tag_id
必需

当前账号的 Web 标签标识符。

类型:string

示例:o3bk1

click_window
可选

此 Web 标签的点击窗口。

注意:仅接受如下所列的可能值。

类型:int

可能值:1714306090

name
可选

Web 标签的名称。

类型:string

示例:Sample single conversion event

retargeting_enabled
可选

指示是否应为此 Web 标签启用重定位。

类型:boolean

可能值:truefalse

type
可选

Web 标签的类型。

类型:enum

可能值:CUSTOMDOWNLOADPURCHASESIGN_UPSITE_VISIT

view_through_window
可选

通过窗口查看此 Web 标签。该值必须始终小于或等于 click_window 值。

注意:仅接受如下所列的可能值。

类型:int

可能值:01714306090

请求示例

PUT https://ads-api.twitter.com/10/accounts/18ce54d4x5t/web_event_tags/o3bk1?type=DOWNLOAD

响应示例

{
  "data": {
    "name": "web event tag",
    "view_through_window": 7,
    "click_window": 7,
    "embed_code": "<script src='"//platform.twitter.com/oct.js"' type='"text/javascript"'></script><script type='"text/javascript"'>twttr.conversion.trackPid('ny3od',  { tw_sale_amount: 0, tw_order_quantity: 0 });</script><noscript><img alt='""' height='"1"' src='"https://analytics.twitter.com/i/adsct?txn_id=ny3od&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0"' style='"display:none;"' width='"1"'/><img alt='""' height='"1"' src='"//t.co/i/adsct?txn_id=ny3od&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0"' style='"display:none;"' width='"1"'/></noscript>",
    "id": "o3bk1",
    "retargeting_enabled": false,
    "status": "UNVERIFIED",
    "type": "DOWNLOAD",
    "website_tag_id": "ny3od",
    "deleted": false
  },
  "request": {
    "params": {
      "web_event_tag_id": "o3bk1",
      "type": "DOWNLOAD",
      "account_id": "18ce54d4x5t"
    }
  }
}

DELETE accounts/:account_id/web_event_tags/:web_event_tag_id

删除关联到当前账号的特定 Web 事件标签。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/web_event_tags/:web_event_tag_id

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

web_event_tag_id
必需

当前账号的 Web 标签标识符。

类型:string

示例:o3bk1

请求示例

DELETE https://ads-api.twitter.com/10/accounts/18ce54d4x5t/web_event_tags/o3bk1

响应示例

{
  "data": {
    "name": "web event tag",
    "view_through_window": 7,
    "click_window": 7,
    "embed_code": "<script src='"//platform.twitter.com/oct.js"' type='"text/javascript"'></script><script type='"text/javascript"'>twttr.conversion.trackPid('ny3od',  { tw_sale_amount: 0, tw_order_quantity: 0 });</script><noscript><img alt='""' height='"1"' src='"https://analytics.twitter.com/i/adsct?txn_id=ny3od&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0"' style='"display:none;"' width='"1"'/><img alt='""' height='"1"' src='"//t.co/i/adsct?txn_id=ny3od&p_id=Twitter&tw_sale_amount=0&tw_order_quantity=0"' style='"display:none;"' width='"1"'/></noscript>",
    "id": "o3bk1",
    "retargeting_enabled": false,
    "status": "UNVERIFIED",
    "type": "DOWNLOAD",
    "website_tag_id": "ny3od",
    "deleted": true
  },
  "request": {
    "params": {
      "web_event_tag_id": "o3bk1",
      "account_id": "18ce54d4x5t"
    }
  }
}