Tagging User Sessions

Tags let you send in any metadata you have about the user or session to be paired with the session recording for viewing and searching. This lets you:

  • Tracking custom events – Did the visitor just encounter an error or do something unexpected? Tag the session with "ran into problem", "used checkout tool", "clicked buy button", or an object with an updatable value, like {converted: true}.
  • Search for sessions by user traits – Send in any information you have about the visitor, common tags including age, gender, user_id, customer_id, date_created, pointsEarned.
  • Integrate Inspectlet with other services – Tags can be used to store information from other services, like the name of the A/B test variation that the user is currently viewing. Common tags include abTestName,campaign_name,referrer_info.

The tagging API lets you send in tags as either key/value pairs or strings. Tag values can be updated by issuing another tag call with the same key and a new value.

Sending in a user's email address (example)

For example, you can send in the email address of the user so that you can search in the Dashboard for all session recordings and data of that user.

Here's an example of tagging a session with the user's email address (key/value pair):

__insp.push(['tagSession', {email: "john@example.com"}]);

The above code creates a tag with the key "email" having the value "john@example.com".

Sending in multiple tags in an object (example)

You can also send in multiple tags in an object, for example if you wanted to send the entire identity of the user:

 __insp.push(['tagSession', {email: "john@example.com", userId: 1258, pointsEarned: 42}]);

Tracking custom events

Tags are also useful for marking sessions where users exhibited interesting behavior, made it to the checkout page, encountered an error, etc. These tags will make sorting through numerous screen captures easier.

For example, the following Javascript code tags a session as "viewed checkout" (simple string tag):

__insp.push(['tagSession', "viewed checkout"]);

In the above case we didn't need a whole key/value, so we just supplied a simple string as a key. A tag must be a string or an object with as many key/value pairs as you want. Tags can be applied at any time and only needs to be set once to tag the entire session, but calling it multiple times (each time a page loads for example) is okay too, duplicate tags will simply be ignored.

Marking sessions where a sale is made (example)

If you're interested in watching all screen captures where a visitor purchased something or made it to the shopping cart page, you can tag those screen captures with a marker like "purchase" like this:

__insp.push(['tagSession', "purchase"]);

This javascript snippet should be called when a visitor visits a specific page, or makes a successful purchase.