Not logged in - Login
< back

Library: Ruby

We have made a library for PHP to help you start using A Trigger in a minute. This PHP library is made to avoid possible errors in your application. Even if ATrigger.com API server become unavailable, your application will work without any problem. On the other hand, all requests are Async by default and no slowness will happen.


Prerequisites

  1. First you need to follow Quick Start Guide.
  2. You have this personal details from your Account Setup page:
    1. API Key
    2. API Secret


Step 1: Initialize

Add analytics-ruby to your project's Gemfile:

gem 'ATrigger'
#gem install ATrigger

Then, add the following to your PHP script:

require_once("/path/to/atriggerphp/ATrigger.php");
//require(dirname(__FILE__) . '/ATriggerPHP/ATrigger.php');

You only need to call init once when your php file is requested. All of your files will then have access to the same ATrigger client.

ATrigger::init("YOUR_APIKey","YOUR_APISecret");
//Debug-friendly: ATrigger::init("YOUR_APIKey","YOUR_APISecret", false, true);

In development you might want to use development settings above to start debugging.


Step 2: Start Using, Functions