Web Event Tags
web-event-tags

Web Event Tags

GET accounts/:account_id/web_event_tags

Retrieve details for some or all web event tags associated with the current account.

Resource URL

https://ads-api.x.com/11/accounts/:account_id/web_event_tags

Parameters

Name Description
account_id
required

The identifier for the leveraged account. Appears within the resource's path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user.

Type: string

Example: 18ce54d4x5t

count
optional

Specifies the number of records to try and retrieve per distinct request.

Type: int

Default: 200
Min, Max: 1, 1000
cursor
optional

Specifies a cursor to get the next page of results. See Pagination for more information.

Type: string

Example: 8x7v00oow

sort_by
optional

Sorts by supported attribute in ascending or descending order. See Sorting for more information.

Type: string

Example: created_at-asc

web_event_tag_ids
optional

Scope the response to just the desired web event tags by specifying a comma-separated list of identifiers. Up to 200 IDs may be provided.

Type: string

Example: o3bk1

with_deleted
optional

Include deleted results in your request.

Type: boolean

Default: false
Possible values: true, false
with_total_count
optional

Include the total_count response attribute.

Note: This parameter and cursor are exclusive.

Note: Requests which include total_count will have lower rate limits, currently set at 200 per 15 minutes.

Type: boolean

Default: false
Possible values: true, false

Example Request

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

Example Response

{
  "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 height="1" width="1" style="display:none;" alt=""  src="https://analytics.twitter.com/i/adsct?txn_id=ny3od&amp;p_id=Twitter&amp;tw_sale_amount=0&amp;tw_order_quantity=0" /><img height="1" width="1" style="display:none;" alt=""  src="//t.co/i/adsct?txn_id=ny3od&amp;p_id=Twitter&amp;tw_sale_amount=0&amp;tw_order_quantity=0" /></noscript>",
      "id": "o3bk1",
      "retargeting_enabled": false,
      "last_tracked_at": "2021-05-22T17:00:04Z",
      "status": "TRACKING",
      "type": "DOWNLOAD",
      "website_tag_id": "ny3od",
      "deleted": false
    }
  ]
}

GET accounts/:account_id/web_event_tags/:web_event_tag_id

Retrieve a specific web event tag associated with the current account.

Resource URL

https://ads-api.x.com/11/accounts/:account_id/web_event_tags/:web_event_tag_id

Parameters

Name Description
account_id
required

The identifier for the leveraged account. Appears within the resource's path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user.

Type: string

Example: 18ce54d4x5t

web_event_tag_id
required

A reference to the web event tag you are operating with in the request.

Type: string

Example: o3bk1

with_deleted
optional

Include deleted results in your request.

Type: boolean

Default: false
Possible values: true, false

Example Request

GET https://ads-api.x.com/11/accounts/18ce54d4x5t/web_event_tags/o3bk1

Example Response

{
  "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 height="1" width="1" style="display:none;" alt=""  src="https://analytics.twitter.com/i/adsct?txn_id=ny3od&amp;p_id=Twitter&amp;tw_sale_amount=0&amp;tw_order_quantity=0" /><img height="1" width="1" style="display:none;" alt=""  src="//t.co/i/adsct?txn_id=ny3od&amp;p_id=Twitter&amp;tw_sale_amount=0&amp;tw_order_quantity=0" /></noscript>",
    "id": "o3bk1",
    "retargeting_enabled": false,
    "last_tracked_at": "2021-05-22T17:00:04Z",
    "status": "TRACKING",
    "type": "DOWNLOAD",
    "website_tag_id": "ny3od",
    "deleted": false
  }
}

POST accounts/:account_id/web_event_tags

Create a new web event tag associated with the current account.

Resource URL

https://ads-api.x.com/11/accounts/:account_id/web_event_tags

Parameters

Name Description
account_id
required

The identifier for the leveraged account. Appears within the resource's path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user.

Type: string

Example: 18ce54d4x5t

click_window
required

The click window for this web tag.

Note: Only the possible values listed below are accepted.

Type: int

Possible values: 1, 7, 14, 30, 60, 90

name
required

The name of the web tag.

Type: string

Example: Sample single conversion event

retargeting_enabled
required

Indicates if retargeting should be enabled for this web tag.

Type: boolean

Possible values: true, false

type
required

The type of web tag.

Type: enum

Possible values: CUSTOM, DOWNLOAD, PURCHASE, SIGN_UP, SITE_VISIT

view_through_window
required

The view through window for this web tag. This value must always be less than or equal to the click_window value.

Note: Only the possible values listed below are accepted.

Type: int

Possible values: 0, 1, 7, 14, 30, 60, 90

Example Request

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

Example Response

{
  "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,
    "last_tracked_at": null,
    "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

Update a web event tag associated with the current account.

Resource URL

https://ads-api.x.com/11/accounts/:account_id/web_event_tags/:web_event_tag_id

Parameters

Name Description
account_id
required

The identifier for the leveraged account. Appears within the resource's path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user.

Type: string

Example: 18ce54d4x5t

web_event_tag_id
required

The identifier for a web tag on the current account.

Type: string

Example: o3bk1

click_window
optional

The click window for this web tag.

Note: Only the possible values listed below are accepted.

Type: int

Possible values: 1, 7, 14, 30, 60, 90

name
optional

The name of the web tag.

Type: string

Example: Sample single conversion event

retargeting_enabled
optional

Indicates if retargeting should be enabled for this web tag.

Type: boolean

Possible values: true, false

type
optional

The type of web tag.

Type: enum

Possible values: CUSTOM, DOWNLOAD, PURCHASE, SIGN_UP, SITE_VISIT

view_through_window
optional

The view through window for this web tag. This value must always be less than or equal to the click_window value.

Note: Only the possible values listed below are accepted.

Type: int

Possible values: 0, 1, 7, 14, 30, 60, 90

Example Request

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

Example Response

{
  "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,
    "last_tracked_at": "2021-05-22T17:00:04Z",
    "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

Delete a specific web event tag associated to the current account.

Resource URL

https://ads-api.x.com/11/accounts/:account_id/web_event_tags/:web_event_tag_id

Parameters

Name Description
account_id
required

The identifier for the leveraged account. Appears within the resource's path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user.

Type: string

Example: 18ce54d4x5t

web_event_tag_id
required

The identifier for a web tag on the current account.

Type: string

Example: o3bk1

Example Request

DELETE https://ads-api.x.com/11/accounts/18ce54d4x5t/web_event_tags/o3bk1

Example Response

{
  "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,
    "last_tracked_at": "2021-05-22T17:00:04Z",
    "status": "UNVERIFIED",
    "type": "DOWNLOAD",
    "website_tag_id": "ny3od",
    "deleted": true
  },
  "request": {
    "params": {
      "web_event_tag_id": "o3bk1",
      "account_id": "18ce54d4x5t"
    }
  }
}