About Events

Follow

Use Events to collect data about interactions with your content

Events are user interactions with content that can be tracked independently from a web page or a mobile application. Buttons, pageviews, pictures etc, practically anything clickable, are all examples of actions you might want to track as Events.
Events are useful in understanding behavior of users on your web or mobile application because Events allow drilling down and grouping data to be more intuitive and flexible. This means that you can use better targeted segments and you will have more accurate data to play with when doing marketing. We also support an attribute inside an event, instead of being "flat" with predefined parameters inside an event. This greatly improves targeting and easens the event configuration to your app or website.

Read more about segments at Segment API Overview.

Adding Event data

You need to add Event tracking code to your site or app in order to see data in your Event reports and segmentation. Read more at Event API Example.

Event Types

An Event has the following types. An Event hit includes a value for each type.

  • StringElement
    • Example: “Johnny”
  • BooleanElement
    • Example: true
  • NumberElement
    • Example: 15.50
  • TimeElement
    • Example: “04:10:00”
  • TimestampElement
    • Example: “2015-10-01 14:00:00”

Structured Events

Beemray also allow to have a structure of an event. A structure within an Event is set of key-(type)-value pairs like:

Lets use an event called "PizzaPayment" with following attributes: title, price, extraCheese, paymentType as an example. Definition of types (human readable in this case, native element types can be found at EventAPI example documentation) will be something like these:

key: title
type: com.beemray.types.event.StringElement

key: price
type: com.beemray.types.event.NumberElement

key: extraCheese
type: com.beemray.types.event.BooleanElement

key: paymentType
type: com.beemray.types.event.StringElement

Now we have a structure defined for an event called "PizzaPayment" within this account/apikey I am working with.

Next step: How to get values for this PizzaPayment event from all the devices that are tracking the event:

Case 1.


Jake buys a pizza from Delipizza's mobile app and confirms the payment after he has chosen a pizza called the "Vegan's heaven". He pays the price of 7EUR. He did not choose any extra cheese and pays it with his debit card. So, the mobile application sends this previously described PizzaPayment event with the following values when "Confirm Payment" button is clicked:

key: title
type: com.beemray.types.event.StringElement
value: Vegan's heaven

key: price
type: com.beemray.types.event.NumberElement
value: 7.0

key: extraCheese
type: com.beemray.types.event.BooleanElement
value: false

key: paymentType
type: com.beemray.types.event.StringElement
value: debit_card

 

Case 2.


Harry loves meat, he is hungry and does not have a lot of money. Still, he _must have_ a_pizza. He saves some cents by leaving the extra cheese out. By clicking the "Confirm payment button" the mobile application sends the event to the backend with the following data (IMPORTANT: Strictly following the structure of event PizzaPayment!!)

key: title
type: com.beemray.types.event.StringElement
value: Chubby ham 'n bacon special

key: price
type: com.beemray.types.event.NumberElement
value: 11.0

key: extraCheese
type: com.beemray.types.event.BooleanElement
value: false

key: paymentType
type: com.beemray.types.event.StringElement
value: credit_card

..and so on

After this (and many other PizzaPayments) you have data to build clever insights and segments using the users’ behaviour on PizzaPayments like "all the PizzaPayments where price is less than 10EUR and paymentType = credit_card" - and way more complex queries as well.

Above example is a simplistic approach of how to work with the Events. Way more complicated stuff can be built using the structured events.

Best practices

The design model for Event tracking is highly flexible, and its use can be extended well beyond the common model of user-triggered events—the design decision is up to you. For this reason, useful Event tracking requires collaboration with your marketing users to plan the best approach for getting the insights that the business needs.

  • Determine in advance all elements for which you want to track data. Even if you initially track only a single object on your website, having an overall sense of the various objects/events you want to track will help you establish a structure that scales well with an increase in the number and type of Event tracking.  
  • Work with your sales and marketing department to plan your Events to be tracked. Knowing in advance what things are useful to drive sales, will direct the structure of your Event tracking implementation. For example, the sales and marketing might be interested in tracking user in various areas of the city , but might also be interested in seeing what is the relation of certain product types with the location. In that case, you can plan ahead to have meaningful names in your event calls. Name is always static - only value varies dependent the location. 
  • Adopt a consistent and clear naming convention. In the process of implementing Event tracking, every name you supply appears in the administration interface.

 

Have more questions? Submit a request

Comments