-
Notifications
You must be signed in to change notification settings - Fork 0
Lua tracker setup
HOME > SNOWPLOW SETUP GUIDE > Step 2: setup a Tracker > Lua tracker
-
- 2.1 Tracker compatibility
- 2.2 Dependencies
- 2.3 Documented environments
-
- 3.1 LuaRocks
- 3.2 Debian/Ubuntu
- 3.3 Embedded environments
The Snowplow Lua Tracker lets you add analytics to your Lua lua-based applications, Lua web servers/frameworks, or from the Lua scripting layer within your games or apps.
The tracker should be relatively straightforward to setup if you are familiar with Lua development.
Ready? Let's get started.
## 2. Integration optionsAs a lightweight, easily-embeddable scripting language, Lua is available in a huge number of different computing environments and platforms, from [World of Warcraft] wow through OpenResty openresty to [Adobe Lightroom] lightroom.
To make the Snowplow Lua Tracker work out-of-the-box with as many different Lua programs as possible, we have tried to:
- Minimize external dependencies
- Provide setup instructions for the most popular Lua environments
To make the Snowplow Lua Tracker work with as many different Lua programs as possible, we have tried to keep external dependencies to a minimum. There is only one external dependency currently:
- LuaSocket luasocket - network support for the Lua language. Required to send events to the Snowplow collector
All other dependencies are bundled with the Lua Tracker itself - see the [src/lib
] tracker-lib folder for details.
Below we provide setup instructions for the following popular Lua environments:
- LuaRocks is a popular deployment and management system for Lua modules
- Debian/Ubuntu for developers working directly with Lua in a Linux environment
- Embedded environments for game, app and SDK developers working with embedded Lua
We expect that the Snowplow Lua Tracker should work in other Lua environments too - please let us know how you get on with setting it up elsewhere.
## 3. Setup ### 3.1 LuaRocksThe Snowplow Lua Tracker is published to LuaRocks luarocks, the popular deployment and management system for Lua modules.
This makes it easy to either install the tracker locally, or to add it as a dependency into your own LuaRocks-based app.
To install the Snowplow Lua Tracker locally (assuming you already have LuaRocks installed):
$ luarocks install SnowplowTracker
To add the Snowplow Tracker as a dependency to your own LuaRocks-based app, edit your rockspec
and add:
dependencies = {
"SnowplowTracker ~> 0.1.0"
}
Done? Now read the Lua Tracker API to start tracking events.
### 3.2 Debian/UbuntuIf your Lua app is running on a Linux box, you will need to install Lua and LuaSocket. On Ubuntu:
$ sudo aptitude install lua liblua5.1-socket2
On Debian:
$ sudo apt-get install lua liblua5.1-socket2
Then download the Snowplow Lua Tracker like so:
$ git clone [email protected]:snowplow/snowplow-lua-tracker.git
Copy the /src/snowplow
folder into your own Lua app's library folder, something like:
$ cp -r snowplow-lua-tracker/src/snowplow my-app/lib/
Now add the Snowplow Lua Tracker into your Lua app's package.path
, like so:
package.path = './lib/?.lua;' .. './lib/snowplow/?.lua;' .. package.path
Done? Now read the Lua Tracker API to start tracking events.
### 3.3 Embedded environmentsFor embedded Lua environments, you will first need to ensure that LuaSocket is available (or installable). Here are instructions for adding LuaSocket into some popular games, SDKs and other apps which use Lua:
Game/app/SDK | LuaSocket bundled? | Installation instructions |
---|---|---|
cocos2d-x cocos2d-x | No | [Installation instructions] cocos2d-x-socket |
[Garry's Mod] gmod | No | [Port of LuaSocket for GMod] gmod-socket |
[Cheat Engine] cheat-engine | No | [Installation instructions] cheat-engine-socket |
Girder girder | Yes ([ref] girder-socket) | Enable the plugin from Girder Settings |
[Corona SDK] corona-sdk | Yes ([ref] corona-sdk-socket) | - |
[LÖVE] love | Yes ([ref] love-socket) | - |
Moai moai | Yes ([ref] moai-socket) | - |
[World of Warcraft] wow | Yes ([ref] wow-socket) | - |
LuaSocket taken care of? Next, download the Snowplow Lua Tracker like so:
$ git clone [email protected]:snowplow/snowplow-lua-tracker.git
Now copy the /src/snowplow
folder into the folder for your Lua scripts, perhaps something like:
$ cp -r snowplow-lua-tracker/src/snowplow my-app/lua-scripts/lib/
Now add the Snowplow Lua Tracker into your Lua app's package.path
, like so:
package.path = './lib/?.lua;' .. './lib/snowplow/?.lua;' .. package.path
That's it! Now read the Lua Tracker API to start tracking events.
Home | About | Project | Setup Guide | Technical Docs | Copyright © 2012-2013 Snowplow Analytics Ltd
HOME > SNOWPLOW SETUP GUIDE > Step 2: Setup a Tracker
- [Step 1: Setup a Collector] (setting-up-a-collector)
- [Step 2: Setup a Tracker] (setting-up-a-tracker)
- 2.1: Setup the Javascript Tracker
- 2.2: Setup the No-JS (pixel) Tracker
- 2.3: Setup the Lua Tracker
- [2.4: Setup the Arduino Tracker] (Arduino-tracker-setup)
- [Step 3: Setup EmrEtlRunner] (setting-up-EmrEtlRunner)
- [Step 4: Setup alternative data stores] (setting-up-alternative-data-stores)
- [Step 5: Analyze your data!] (Getting started analyzing Snowplow data)
Useful resources