Giter Site home page Giter Site logo

ga4unity's Introduction

# Google Analytics for Unity3D, 2012 Florian Piesche / [email protected] / @ektoutie

CAVEAT: This will only work on its own for native builds. For Web Player builds, you will need
  to add Google Analytics' ga.js to the page the game is embedded in.

USAGE: drop in your assets folder. Attach to any GameObject as a Component.
   Call SetID method with your GA Tracking ID (UA-12345678-9) and the domain DeviceName
   you're using in GA. From then on, just call either of the two methods to log info/events
   to Google Analytics.


METHODS:

  SetID(TrackingID as string, Domain as string), returns boolean
      Sets tracking up with your Google Analytics tracking ID (which you can find in your
      GA account) and the domain name to log things for. Returns false if there is no
      internet connection available (and thus tracking won't work).

  LogInfo(Prefix as string)
      logs system info (OS, Device Name, Device Type) as events with category Prefix.
      Prefix should be your game title or some other easily recognisable tag.

  LogEvent(EventCat as string, Event as string, EventLabel as string, EventValue as single)
      logs an event to Google Analytics with the custom text/value as above.
      Example: LogEvent("MyGameTitle", "StartLevel", "Level1", 1) to log the first
                 attempt at starting Level 1 of your game.
               LogEvent("MyGameTitle", "PlayerDeath", "Orc", 42.3) to log a player's death
                 to an Orc after 42.3 seconds of gameplay.


EXAMPLES:

  self.gaScript.SetID("UA-12345678-9", "mydomain.com")
  self.gaScript.LogInfo("myGame")
  self.gaScript.LogEvent("myGame", "startLevel", "2", 0.0)
  

ga4unity's People

Contributors

fpiesche avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.