mintance / mintance-php
The Official PHP library for Mintance
1.0.5
2017-09-05 13:01 UTC
Requires
- php: >=5.0
Requires (Dev)
- phpdocumentor/phpdocumentor: 2.*
- phpunit/phpunit: 4.7.*
This package is not auto-updated.
Last update: 2025-05-22 09:27:22 UTC
README
This library provides an API to track events and update profiles on Mintance.
Install with Composer
Add mintance/mintance-php as a dependency and run composer update
$ composer require mintance/mintance-php
Or:
{ "require": { "mintance/mintance-php" : "1.*" } }
Now you can start tracking events and people:
<?php // Import dependencies require 'vendor/autoload.php'; // Create Mintance class, replace with your project token $mt = new Mintance("PROJECT_TOKEN"); // Identify your contact. $mt->people->setIdentifier("my_people_id"); // Track an event $mt->track("button clicked", array("label" => "sign-up")); // Create/Update a profile for user id 12345 $mt->people->set(array( 'first_name' => "John", 'last_name' => "Doe", 'email' => "john.doe@example.com", 'phone' => "5555555555", // Custom fields 'Favorite Color' => "red" ));
Install Manually
- Download the Mintance PHP Library
- Extract the zip file to a directory called "mintance-php" in your project root
- Now you can start tracking events and people:
<?php // Import Mintance require 'mintance-php/src/Mintance.php'; // Create Mintance class, replace with your project token $mt = new Mintance("PROJECT_TOKEN"); // Track an event $mt->track("button clicked", array("label" => "sign-up")); // Create/Update a profile for user id 12345 $mt->people->set(array( 'first_name' => "John", 'last_name' => "Doe", 'email' => "john.doe@example.com", 'phone' => "5555555555", // Custom fields 'Favorite Color' => "red" ));