ThoughtMetric

Data insert API

View product

GET https://data.thoughtmetric.io/d

Records a product view. These count toward the view_contents metric on the REST API. Note the event name is viewContent, not viewProduct.

Example request

curl -G https://data.thoughtmetric.io/d \
  -d id=ID-bcd0aa692ce7e6b2 \
  -d uid=8824a9fc-002d-4fb8-bcea-9e60225a88f0 \
  -d ht=event \
  -d ev=viewContent \
  -d v=api \
  -d ip=203.0.113.42 \
  --data-urlencode dl=https://example-store.com/products/wool-crew \
  -d ts=2024-01-31T18:22:04Z

Query parameters

id string, required Your Project ID.
uid string, required UUID identifying the visitor.
ht string, required Always event for this call.
ev string, required Always viewContent for this call.
v string Always api for this call.
ip string Visitor's IP address.
dl string URL of the product page viewed.
rl string Referring URL.
ts string Time of the event. ISO 8601 or Unix seconds.

Notes

  • A product view is a separate event from a pageview. If you want the visit counted in traffic metrics as well, send a pageview too.