snowplow / snowplow-lua-tracker

Snowplow event tracker for Lua. Add analytics to your Lua apps and Lua-scripted games
http://snowplowanalytics.com
4 stars 3 forks source link

Lua Analytics for Snowplow

early-release Build Status License

Overview

Add analytics to your Lua apps and Lua-scripted games with the Snowplow event tracker for Lua.

With this tracker you can collect event data from your Lua-based applications, Lua web servers/frameworks, or from the Lua scripting layer within your games or apps.

Maintainer quick start

Build Requirements

Ensure you have the following installed on your system:

If using brew, simply run:

brew install lua luarocks curl

Installing dependencies

luarocks install snowplowtracker-0.2.0-1 --deps-only

Note: There are two path args you may need to pass in if luarocks cannot find them, CURL_DIR, and UUID_DIR.

An example if curl was installed via brew, depending on your architecture:

Intel MacOS

luarocks install snowplowtracker-scm-1.rockspec --deps-only CURL_DIR=/usr/local/Cellar/curl/7.81.0

ARM MacOS

luarocks install snowplowtracker-scm-1.rockspec --deps-only CURL_DIR=/opt/homebrew/opt/curl

Building the project

With all dependencies installed, run:

luarocks build

Tests

To run tests, you will need busted:

luarocks install busted

These tests require a Snowplow collector, so there are a couple of ways you're able to run them:

run-test script

This script will handle downloading and running Micro for the tests, you just need to run:

./run-tests

You are able to use any busted arguments with this script, for example:

./run-tests --pattern=tracker_spec.lua

Running with your own collector

You are also able to run these tests with any collector by setting the MICRO_URL envvar to the collector URL, and then running busted:

set MICRO_URL=http://localhost:9090
busted

Luacheck

Luacheck, a static analyser, is used with this project. To check all files, first install luacheck:

luarocks install luacheck

Then run:

luacheck .

Find out more

Snowplow Docs Setup Guide Contributing
i1 i2 i4
Snowplow Docs Setup Guide Contributing

Contributing

Feedback and contributions are welcome - if you have identified a bug, please log an issue on this repo. For all other feedback, discussion or questions please open a thread on our Discourse forum.

Copyright and license

The Snowplow Lua Tracker is copyright 2013 - 2022 Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.