lukapeharda/improvely

Improvely API PHP SDK

v1.0.0 2019-12-04 12:59 UTC

This package is auto-updated.

Last update: 2024-12-04 23:58:49 UTC


README

Server-side HTTP API that you can use to perform account management tasks and to add conversion events that do not occur on your website, but can still be linked to a specific website visitor, such as recurring bills.

Installation

composer require lukapeharda/improvely

Requirements

Make sure to find your Improvely API key and project ID.

Usage

Conversions

Docs for conversions can be found here. Make sure to check required params, its combos and all other attributes.

key and project attributes will be auto inserted, all others can be set freely.

In order to be able to record a conversion, you need to label your visitor beforehand.

Recording a conversion:

...
$apiKey = '#YOUR_API_KEY#';
$projectID = '#YOUR_PROJECT_ID#';

$client = new LukaPeharda\Improvely\Conversion($apiKey, $projectId);

$params = [
    'label' => '#LABELED_VISITOR_ID_OR_EMAIL_OR_USERNAME#', // this value depends on what you've used to label your user with
    'goal' => 'purchase',
    'revenue' => 19.99,
];

$response = $client->record($params);
...

Other API endpoints

So far only conversions have been implemented. For other actions do submit an issue or do a pull request. Thank you.