Tealium for Ruby

Tealium for Ruby

by 3 weeks ago - edited 3 weeks ago by (205 Views)

This document describes how to add the Tealium RubyGem to your project to track user activity.

In this article:

Table of Contents Placeholder


  • This feature requires a Tealium account enabled for AudienceStream, DataAccess, or EventStream.
  • Use of this software is subject to the terms and conditions of the license agreement contained in the  file titled "LICENSE.txt". Read the license before downloading or using any of the files contained in this repository. By downloading or using any of these files, you are agreeing to be bound by and comply with the license agreement.


To install the tealium gem, type the following from the command line:

$ gem install tealium-1.0.0.gem


To import the Tealium package, type the following:

require 'tealium'

After the Tealium gem is installed, initialize a Tealium object using the following parameters, as shown in the example.

  • account – The name of your Tealium account.
  • profile – The name of your Tealium profile.
  • datasource – (optional) The data source key from UDH.
teal = Tealium.new(account, profile, datasource)


After the Tealium object is initialized, begin tracking events using the track() method with the following parameters:

  • event_name – The name that identifies your event (passed to tealium_event).
  • custom_data – Optional. Custom data to send with track call.
teal.track(event_name, {:key => "value"})