Videos APIGuides

Update pixels

Attach tracking pixels and choose when in playback they fire.

Pixels fire tracking events as the video plays. items is a collection, so the merge works per item: an item with an id patches that pixel, an item without one creates a new pixel, and an item with "_destroy": true deletes it. Pixels you don't mention stay as they are.

This is a merge-patch: send only the keys you want to change and everything else keeps its stored value.

Fire a custom pixel at 50%

curl -X PATCH https://api.vturb.com/v1/videos/{id} \
  -H "Authorization: Bearer vt_..." \
  -H "Content-Type: application/json" \
  -d '{ "pixels": { "enabled": true, "items": [
        { "base": { "name": "Half-view", "type": "custom" },
          "tag": { "html": "<script>track()</script>" },
          "dispatch": { "active": true, "mode": "percent", "threshold": 50 } }
      ] } }'

The keys

KeyTypeWrites
enabledbooleanMaster switch for all pixels
items[].idstringTargets an existing pixel; omit to create one
items[]._destroybooleantrue deletes the pixel the id points to
items[].base.namestringInternal label of the pixel
items[].base.typestringfacebook, google or custom
items[].tag.htmlstringThe HTML/JS snippet a custom pixel injects
items[].dispatch.activebooleanTurns firing on or off for this pixel
items[].dispatch.modestringpercent (of the video watched) or time (seconds played)
items[].dispatch.thresholdintegerThe percent or second at which the pixel fires

On this page