2017 © Pedro Peláez
 

library calq

Calq API client for PHP

image

calq/calq

Calq API client for PHP

  • Tuesday, April 7, 2015
  • by RRAway
  • Repository
  • 2 Watchers
  • 2 Stars
  • 4,513 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Calq PHP Client

The full quick start and reference docs can be found at: https://www.calq.io/docs/client/php, (*1)

Installation

Install the latest release of the library through Composer with the following command:, (*2)

composer require calq/calq

Old-style copy-and-paste

Grab the latest release and add it to your project., (*3)

You will need to include the CalqClient library where you intend to use it. The library requires PHP 5.2 or higher., (*4)

require_once("/path/to/Client-PHP/lib/CalqClient.php");

Getting a client instance

The easiest way to get an instance of the client is to use the static CalqClient::fromCurrentRequest method. This will create a client using any cookie already data set for the current web request. If the current user has never been seen before the client will remember them in future by writing a cookie to the response., (*5)

You will need to add your Calq project's write key where it says YOUR_WRITE_KEY_HERE. You can find your write key from the project settings option inside Calq., (*6)

// Get an instance populated from the current request
$calq = CalqClient::fromCurrentRequest('YOUR_WRITE_KEY_HERE');

The PHP client is compatible with the JavaScript client. Any properties set client side using JavaScript will be read by the PHP client when using the CalqClient::fromCurrentRequest method. Likewise any properties set server side will be persisted to a cookie to be read browser side., (*7)

Tracking actions

Calq performs analytics based on actions that user's take. You can track an action using track. Specify the action and any associated data you wish to record., (*8)

// Track a new action called 'Product Review' with a custom rating
$calq->track('Product Review', array('Rating' => 9.0));

The array parameter allows you to send additional custom data about the action. This extra data can be used to make advanced queries within Calq., (*9)

Documentation

The full quick start can be found at: https://www.calq.io/docs/client/php, (*10)

The reference can be found at: https://www.calq.io/docs/client/php/reference, (*11)

License

Licensed under the Apache License, Version 2.0., (*12)

The Versions

07/04 2015

dev-master

9999999-dev https://github.com/Calq/Client-PHP

Calq API client for PHP

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0
  • lib-curl *
  • ext-json *

 

calq

07/04 2015

1.0.3

1.0.3.0 https://github.com/Calq/Client-PHP

Calq API client for PHP

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0
  • lib-curl *
  • ext-json *

 

calq