User tracking

You can optionally track user behaviour and register all actions a user takes in the webshop. This includes adding tickets to orders, viewing the basket, starting checkout and confirming the order.

User tracking in Ticketmatic is not an out of the box, standalone solution. The user actions in the Ticketmatic webshop are only a part of the complete user behaviour on your channels (website, app,…). The main idea is that the user actions in Ticketmatic can be integrated in this larger picture. Setting this up requires technical knowledge and you might need the help of a partner to implement this for your specific situation. Good candidates are:

  • your website builder
  • your website-ticketing integrator
  • your marketing partner

In order to be compliant with privacy laws like GDPR, this user tracking is completely optional. As data controller you should verify whether you need to get consent from the user to track and process this information. User tracking data is stored exclusively in Ticketmatic, no external services are involved. Ticketmatic webshop pages will not contain any other trackers or scripts and Ticketmatic will only use cookies that are essential for processing the order and authenticating the user.

How to activate tracking

If you get the right consent from the user, you can activate tracking for a widget or sales flow by passing an extra querystring parameter ref. This parameter is used to link the user actions in Ticketmatic with the actions of this user on your other channels. As value for the ref parameter, you can for example specify a userid or clientid that is used on the website. This value will be stored together with the user actions, allowing you to make the link when retrieving the data.

Ticketmatic will not process or use this value in any way and will store and return this unaltered, so you are free to use this as you want.

If you don’t pass a ref parameter, user actions will not be tracked for that widget or salesflow session.

The ref parameter does not need to be included in the signature for widgets, so you can simply append it to a generated widget or ticket sales flow link.

For example:

If you have this sales flow url: https://test.ticketmatic.com/widgets/demo_tm3/flow/saleslink?event=130716474767&l=en

You can simply append a ref parameter: https://test.ticketmatic.com/widgets/demo_tm3/flow/saleslink?event=130716474767&l=en&ref=user1234

How to retrieve and process the user tracking data

All user tracking data is stored by Ticketmatic and can be retrieved using the API.

In order to continuously consume the stream of user tracking data, you will need to implement a long-running process or periodic job. By polling the eventstream endpoint you can iterate over all user tracking data and process it (for example by sending it to Google Analytics or other analytics tools).

User tracking data is available almost instantly on the eventstream, so there is very little delay between the user action and you processing this action.

Polling the eventstream

Calling the eventstream endpoint is easy, for example:

curl -u '<accesskey>:<secretkey>' 'https://apps.ticketmatic.com/api/1/<accountname>/eventstream'

The call will return an object with 3 keys:

  • results
  • nextid
  • moreresults

results contains an array of eventstream items. Each item is an object with a set of fixed keys, and one of the keys is the id. Each eventstream item is assigned a unique (and ascending) id. nextid indicates the id to start on when you next call the eventstream, and moreresults is a boolean an indicates if there are more eventstream items waiting for you.

Calling eventstream without parameters returns the oldest available eventstream items. You can pass a parameter id to retrieve all items from that id on:

curl -u '<accesskey>:<secretkey>' 'https://test.ticketmatic.com/api/1/<accountname>/eventstream?id=<nextid>'

So to consume the eventstream:

  • call the endpoint
  • process the results
  • if moreresults is true, immediately call the endpoint again with nextid as parameter and loop
  • if moreresults is false, wait 5-60 seconds and loop

Ticketmatic stores eventstream items for 4 hours. So you should process the items within that timeframe.

Processing the results

Each eventstream result item is an object containing keys:

  • id
  • ts
  • type
  • data

id is the unique id for this item, and ts is the timestamp in ISO 8601 format (UTC).

type defines what the eventstream item is, and is a value from this list:

  • webshop:add_tickets
  • webshop:add_products
  • webshop:remove_tickets
  • webshop:remove_products
  • webshop:checkout_start
  • webshop:checkout_addcustomerinfo
  • webshop:checkout_adddeliveryinfo
  • webshop:checkout_addpaymentinfo
  • webshop:checkout_initiatepayment
  • webshop:checkout_confirm
  • webshop:pageview

Other types might be added in the future, so make sure to filter on this and process only the items relevant to you.

Depending on the type, relevant information is returned in the data property. All items wil contain the ref key with the value you passed in the querystring.

webshop:add_tickets

When a user adds tickets to the basket. The tickets key contains an array with one object for each added ticket. The order key contains the state of the order after the tickets were added.

 1{
 2  "id": "1661358385340-0",
 3  "ts": "2022-09-13T11:46:25",
 4  "type": "webshop:add_tickets",
 5  "data": {
 6    "tickets": [
 7      {
 8        "id": "10634",
 9        "price": "20",
10        "servicecharge": "0",
11        "tickettypepriceid": "580",
12        "tickettypeid": "92",
13        "tickettypename": "Tickets",
14        "pricetypeid": "10000",
15        "pricetypename": "Normal",
16        "eventid": "10003",
17        "eventname": "Dance performance 2"
18      },
19      {
20        "id": "10635",
21        "price": "20",
22        "servicecharge": "0",
23        "tickettypepriceid": "580",
24        "tickettypeid": "92",
25        "tickettypename": "Tickets",
26        "pricetypeid": "10000",
27        "pricetypename": "Normal",
28        "eventid": "10003",
29        "eventname": "Dance performance 2"
30      }
31    ],
32    "order": {
33      "id": "398",
34      "saleschannelid": "10000",
35      "customerid": null,
36      "deliveryscenarioid": null,
37      "paymentscenarioid": null,
38      "totalamount": "40",
39      "tickets": [
40        {
41          "id": "10634",
42          "price": "20",
43          "servicecharge": "0",
44          "tickettypepriceid": "580",
45          "tickettypeid": "92",
46          "tickettypename": "Tickets",
47          "pricetypeid": "10000",
48          "pricetypename": "Normal",
49          "eventid": "10003",
50          "eventname": "Dance performance 2"
51        },
52        {
53          "id": "10635",
54          "price": "20",
55          "servicecharge": "0",
56          "tickettypepriceid": "580",
57          "tickettypeid": "92",
58          "tickettypename": "Tickets",
59          "pricetypeid": "10000",
60          "pricetypename": "Normal",
61          "eventid": "10003",
62          "eventname": "Dance performance 2"
63        }
64      ],
65      "products": [
66      ]
67    },
68    "ref": "user12345"
69  }
70}

webshop:remove_tickets

When a user removes tickets from the basket. The tickets key contains an array with one object for each removed ticket. The order key contains the state of the order after the tickets were added.

Remark that when a user revisits the addtickets page after previously adding tickets and changes the number of tickets he wants, this can result in a `webshop:remove_tickets` action for **all** tickets and then a `webshop:add_tickets` action for the new number of tickets.
 1{
 2  "id": "1661359082144-0",
 3  "ts": "2022-09-13T11:58:02",
 4  "type": "webshop:remove_tickets",
 5  "data": {
 6    "tickets": [
 7      {
 8        "id": "10635",
 9        "price": "20",
10        "servicecharge": "0",
11        "tickettypepriceid": "580",
12        "tickettypeid": "92",
13        "tickettypename": "Tickets",
14        "pricetypeid": "10000",
15        "pricetypename": "Normal",
16        "eventid": "10003",
17        "eventname": "Dance performance 2"
18      }
19    ],
20    "order": {
21      "id": "398",
22      "saleschannelid": "10000",
23      "customerid": null,
24      "deliveryscenarioid": null,
25      "paymentscenarioid": null,
26      "totalamount": "40",
27      "tickets": [
28        {
29          "id": "10636",
30          "price": "20",
31          "servicecharge": "0",
32          "tickettypepriceid": "580",
33          "tickettypeid": "92",
34          "tickettypename": "Tickets",
35          "pricetypeid": "10000",
36          "pricetypename": "Normal",
37          "eventid": "10003",
38          "eventname": "Dance performance 2"
39        },
40        {
41          "id": "10637",
42          "price": "20",
43          "servicecharge": "0",
44          "tickettypepriceid": "580",
45          "tickettypeid": "92",
46          "tickettypename": "Tickets",
47          "pricetypeid": "10000",
48          "pricetypename": "Normal",
49          "eventid": "10003",
50          "eventname": "Dance performance 2"
51        }
52      ],
53      "products": [
54      ]
55    },
56    "ref": "user12345"
57  }
58}

webshop:add_products

When a user adds products to the basket. The products key contains an array with one object for each added product. The order key contains the state of the order after the products were added.

 1{
 2  "id": "1661359739037-0",
 3  "ts": "2022-09-13T12:08:59",
 4  "type": "webshop:add_products",
 5  "data": {
 6    "products": [
 7      {
 8        "id": "10001",
 9        "productid": "10000",
10        "price": "100",
11        "producttype": "26002",
12        "productname": "Gift voucher"
13      },
14      {
15        "id": "10002",
16        "productid": "10000",
17        "price": "100",
18        "producttype": "26002",
19        "productname": "Gift voucher"
20      }
21    ],
22    "order": {
23      "id": "398",
24      "saleschannelid": "10000",
25      "customerid": null,
26      "deliveryscenarioid": null,
27      "paymentscenarioid": null,
28      "totalamount": "240",
29      "tickets": [
30        {
31          "id": "10636",
32          "price": "20",
33          "servicecharge": "0",
34          "tickettypepriceid": "580",
35          "tickettypeid": "92",
36          "tickettypename": "Tickets",
37          "pricetypeid": "10000",
38          "pricetypename": "Normal",
39          "eventid": "10003",
40          "eventname": "Dance performance 2"
41        },
42        {
43          "id": "10637",
44          "price": "20",
45          "servicecharge": "0",
46          "tickettypepriceid": "580",
47          "tickettypeid": "92",
48          "tickettypename": "Tickets",
49          "pricetypeid": "10000",
50          "pricetypename": "Normal",
51          "eventid": "10003",
52          "eventname": "Dance performance 2"
53        }
54      ],
55      "products": [
56        {
57          "id": "10001",
58          "productid": "10000",
59          "price": "100",
60          "producttype": "26002",
61          "productname": "Gift voucher"
62        },
63        {
64          "id": "10002",
65          "productid": "10000",
66          "price": "100",
67          "producttype": "26002",
68          "productname": "Gift voucher"
69        }
70      ]
71    },
72    "ref": "user12345"
73  }
74}

webshop:remove_products

When a user removes products from the basket. The products key contains an array with one object for each removed product. The order key contains the state of the order after the products were removed.

 1{
 2  "id": "1661439554553-0",
 3  "ts": "2022-09-13T10:19:14",
 4  "type": "webshop:remove_products",
 5  "data": {
 6    "products": [
 7      {
 8        "id": "10004",
 9        "productid": "10000",
10        "price": "100",
11        "producttype": "26002",
12        "productname": "Gift voucher"
13      }
14    ],
15    "order": {
16      "id": "401",
17      "saleschannelid": "10000",
18      "customerid": null,
19      "deliveryscenarioid": "10000",
20      "paymentscenarioid": "10001",
21      "totalamount": "100",
22      "tickets": [
23      ],
24      "products": [
25        {
26          "id": "10003",
27          "productid": "10000",
28          "price": "100",
29          "producttype": "26002",
30          "productname": "Gift voucher"
31        }
32      ]
33    },
34    "ref": "user23456"
35  }
36}

webshop:checkout_start

When a user starts the checkout process. The order key contains the state of the order.

 1{
 2  "id": "1661359739319-0",
 3  "ts": "2022-09-13T12:08:59",
 4  "type": "webshop:checkout_start",
 5  "data": {
 6    "order": {
 7      "id": "398",
 8      "saleschannelid": "10000",
 9      "customerid": null,
10      "deliveryscenarioid": null,
11      "paymentscenarioid": null,
12      "totalamount": "240",
13      "tickets": [
14        {
15          "id": "10636",
16          "price": "20",
17          "servicecharge": "0",
18          "tickettypepriceid": "580",
19          "tickettypeid": "92",
20          "tickettypename": "Tickets",
21          "pricetypeid": "10000",
22          "pricetypename": "Normal",
23          "eventid": "10003",
24          "eventname": "Dance performance 2"
25        },
26        {
27          "id": "10637",
28          "price": "20",
29          "servicecharge": "0",
30          "tickettypepriceid": "580",
31          "tickettypeid": "92",
32          "tickettypename": "Tickets",
33          "pricetypeid": "10000",
34          "pricetypename": "Normal",
35          "eventid": "10003",
36          "eventname": "Dance performance 2"
37        }
38      ],
39      "products": [
40        {
41          "id": "10001",
42          "productid": "10000",
43          "price": "100",
44          "producttype": "26002",
45          "productname": "Gift voucher"
46        },
47        {
48          "id": "10002",
49          "productid": "10000",
50          "price": "100",
51          "producttype": "26002",
52          "productname": "Gift voucher"
53        }
54      ]
55    },
56    "ref": "user12345"
57  }
58}

webshop:checkout_addcustomerinfo

When a user adds customer info during the checkout process. The order key contains the state of the order. order.customerid contains the id of the customer.

 1{
 2  "id": "1661360224312-0",
 3  "ts": "2022-09-13T12:17:04",
 4  "type": "webshop:checkout_addcustomerinfo",
 5  "data": {
 6    "order": {
 7      "id": "398",
 8      "saleschannelid": "10000",
 9      "customerid": "10016",
10      "deliveryscenarioid": "10000",
11      "paymentscenarioid": "10001",
12      "totalamount": "240",
13      "tickets": [
14        {
15          "id": "10636",
16          "price": "20",
17          "servicecharge": "0",
18          "tickettypepriceid": "580",
19          "tickettypeid": "92",
20          "tickettypename": "Tickets",
21          "pricetypeid": "10000",
22          "pricetypename": "Normal",
23          "eventid": "10003",
24          "eventname": "Dance performance 2"
25        },
26        {
27          "id": "10637",
28          "price": "20",
29          "servicecharge": "0",
30          "tickettypepriceid": "580",
31          "tickettypeid": "92",
32          "tickettypename": "Tickets",
33          "pricetypeid": "10000",
34          "pricetypename": "Normal",
35          "eventid": "10003",
36          "eventname": "Dance performance 2"
37        }
38      ],
39      "products": [
40        {
41          "id": "10001",
42          "productid": "10000",
43          "price": "100",
44          "producttype": "26002",
45          "productname": "Gift voucher"
46        },
47        {
48          "id": "10002",
49          "productid": "10000",
50          "price": "100",
51          "producttype": "26002",
52          "productname": "Gift voucher"
53        }
54      ]
55    },
56    "ref": "user12345"
57  }
58}

webshop:checkout_adddeliveryinfo

When a user adds delivery info during the checkout process. The order key contains the state of the order. order.deliveryscenarioid contains the id of the selected delivery scenario.

 1{
 2  "id": "1664159739545-0",
 3  "ts": "2022-09-13T12:08:59",
 4  "type": "webshop:checkout_adddeliveryinfo",
 5  "data": {
 6    "order": {
 7      "id": "398",
 8      "saleschannelid": "10000",
 9      "customerid": null,
10      "deliveryscenarioid": "10000",
11      "paymentscenarioid": null,
12      "totalamount": "240",
13      "tickets": [
14        {
15          "id": "10636",
16          "price": "20",
17          "servicecharge": "0",
18          "tickettypepriceid": "580",
19          "tickettypeid": "92",
20          "tickettypename": "Tickets",
21          "pricetypeid": "10000",
22          "pricetypename": "Normal",
23          "eventid": "10003",
24          "eventname": "Dance performance 2"
25        },
26        {
27          "id": "10637",
28          "price": "20",
29          "servicecharge": "0",
30          "tickettypepriceid": "580",
31          "tickettypeid": "92",
32          "tickettypename": "Tickets",
33          "pricetypeid": "10000",
34          "pricetypename": "Normal",
35          "eventid": "10003",
36          "eventname": "Dance performance 2"
37        }
38      ],
39      "products": [
40        {
41          "id": "10001",
42          "productid": "10000",
43          "price": "100",
44          "producttype": "26002",
45          "productname": "Gift voucher"
46        },
47        {
48          "id": "10002",
49          "productid": "10000",
50          "price": "100",
51          "producttype": "26002",
52          "productname": "Gift voucher"
53        }
54      ]
55    },
56    "ref": "user12345"
57  }
58}

webshop:checkout_addpaymentinfo

When a user adds payment info during the checkout process. The order key contains the state of the order. order.paymentscenarioid contains the id of the selected payment scenario.

webshop:checkout_initiatepayment

When a user start the payment process and is redirected to the PSP. The order key contains the state of the order.

 1{
 2  "id": "1664310309368-0",
 3  "ts": "2022-09-13T12:18:29",
 4  "type": "webshop:checkout_initiatepayment",
 5  "data": {
 6    "order": {
 7      "id": "398",
 8      "saleschannelid": "10000",
 9      "customerid": "10016",
10      "deliveryscenarioid": "10000",
11      "paymentscenarioid": "10001",
12      "totalamount": "240",
13      "tickets": [
14        {
15          "id": "10636",
16          "price": "20",
17          "servicecharge": "0",
18          "tickettypepriceid": "580",
19          "tickettypeid": "92",
20          "tickettypename": "Tickets",
21          "pricetypeid": "10000",
22          "pricetypename": "Normal",
23          "eventid": "10003",
24          "eventname": "Dance performance 2"
25        },
26        {
27          "id": "10637",
28          "price": "20",
29          "servicecharge": "0",
30          "tickettypepriceid": "580",
31          "tickettypeid": "92",
32          "tickettypename": "Tickets",
33          "pricetypeid": "10000",
34          "pricetypename": "Normal",
35          "eventid": "10003",
36          "eventname": "Dance performance 2"
37        }
38      ],
39      "products": [
40        {
41          "id": "10001",
42          "productid": "10000",
43          "price": "100",
44          "producttype": "26002",
45          "productname": "Gift voucher"
46        },
47        {
48          "id": "10002",
49          "productid": "10000",
50          "price": "100",
51          "producttype": "26002",
52          "productname": "Gift voucher"
53        }
54      ]
55    },
56    "ref": "user12345"
57  }
58}

webshop:checkout_confirm

When payment is confirmed and the user returns to Ticketmatic and sees the order detail page. The order key contains the state of the order.

 1{
 2  "id": "1664419049115-0",
 3  "ts": "2022-09-13T10:10:49",
 4  "type": "webshop:checkout_confirm",
 5  "data": {
 6    "order": {
 7      "id": "400",
 8      "saleschannelid": "10000",
 9      "customerid": "10016",
10      "deliveryscenarioid": "10000",
11      "paymentscenarioid": "10001",
12      "totalamount": "40",
13      "tickets": [
14        {
15          "id": "10640",
16          "price": "20",
17          "servicecharge": "0",
18          "tickettypepriceid": "580",
19          "tickettypeid": "92",
20          "tickettypename": "Tickets",
21          "pricetypeid": "10000",
22          "pricetypename": "Normal",
23          "eventid": "10003",
24          "eventname": "Dance performance 2"
25        },
26        {
27          "id": "10641",
28          "price": "20",
29          "servicecharge": "0",
30          "tickettypepriceid": "580",
31          "tickettypeid": "92",
32          "tickettypename": "Tickets",
33          "pricetypeid": "10000",
34          "pricetypename": "Normal",
35          "eventid": "10003",
36          "eventname": "Dance performance 2"
37        }
38      ],
39      "products": [
40      ]
41    },
42    "ref": "user23456"
43  }
44}

webshop:pageview

When a user views a page in the widget.

The page key returns the name of the visited page. The params object returns the widget parameters for the page.

 1{
 2  "id": "1661438970777-0",
 3  "ts": "2022-09-13T10:09:30",
 4  "type": "webshop:pageview",
 5  "data": {
 6    "page": "summary",
 7    "params": {
 8      "edit": "yes",
 9      "flow": "basketwithcheckout",
10      "skinid": "10000",
11      "returnurl": "https://www.ticketmatic.com/",
12      "saleschannelid": "10000",
13      "reservemoretickets": "yes",
14      "event": "10003",
15      "withauthentication": "no",
16      "subscribe": "no",
17      "detail": "ticketdetails",
18      "panels": "voucher,customer,delivery,payment,extrainfo",
19      "oncompletion": "orderdetail",
20      "requiredfields": "",
21      "product": "",
22      "ticketcustomfields": "",
23      "requiredticketcustomfields": "",
24      "ticketinfo": "",
25      "extraevents": "",
26      "extraproducts": "",
27      "promocode": null
28    },
29    "orderid": "400",
30    "customerid": "10016",
31    "ref": "user23456"
32  }
33}

Questions?

We're always happy to help! Send us an e-mail