PHP Client SDK for Vantevo Analytics.

1.0.2 2022-12-12 05:43 UTC

This package is auto-updated.

Last update: 2024-11-12 10:01:04 UTC


README

Vantevo Analytics is the alternative platform to Google Analytics that respects privacy, because it does not need cookies not compliant with the GDPR. Easy to use, light and can be integrated into any website and back-end.

This is the official PHP client SDK for Vantevo Analytics. For more information visit the website vantevo.io.

Installation

You can install the SDK using Composer or by copying the src/Client.php directly.

composer require vantevo-analytics/sdk

Usage

To start tracking page views, events, and getting statistics, you need to initialize the client first:

require __DIR__ . '/vendor/autoload.php'; // or require_once 'src/Client.php';

$client = new Vantevo\Client('accessToken', 'domain', 'timeout' 'dev');

Tracking page views and events

Parameters

parameters

Example pageview

try {
    $data = array("event" => "pageview", "title" => "Eaxmple Page view");
	$client->event($data);
} catch (Exception $e) {
	// something went wrong...
}

Example event

try {
    $data = array("event" => "Download", "meta" => array("pdf": "Recipes"));
	$client->event($data);
} catch (Exception $e) {
	// something went wrong...
}

Monitoring Ecommerce

In the ecommerce section of Vantevo you can monitor specific actions affecting your ecommerce website and the sources of traffic that lead to sales.

parameters

List events

These are the events to use to monitor your ecommerce:

Example

An example for how to use the trackEcommerce function.

try {
    $data = array(
		"event" => "view_item",
		"items" => array(
			array(
				"item_id" => "SKU_123",
				"item_name" => "Samsung Galaxy",
				"currency" => "EUR",
				"quantity" => 0,
				"price" => 199.99,
				"discount" => 0,
				"position" => 1,
				"brand" => "Samsung",
				"category_1" => "Smartphone",
				"category_2" => "Samsung",
				"category_3" => "Galaxy",
				"category_4" => "",
				"category_5" => "",
				"variant_1" => "Black",
				"variant_2" => "5.5 inch",
				"variant_3" => ""
			)
		)
		);
	$client->trackEcommerce($data);
} catch (Exception $e) {
	// something went wrong...
}

Read our guide for more information of how to use the ecommerce tracking function.

How to get the statistics

Parameters

Example Statistics

try {
    $data = array("source" => "pages", "period" => "1m");
	$stats = $client->stats($data);
} catch (Exception $e) {
	// something went wrong...
}

Example Events

try {
    $data = array("source" => "events", "period" => "1m");
	$events = $client->events($data);
} catch (Exception $e) {
	// something went wrong...
}

Vantevo Analytics guide

To see all the features and settings of Vantevo Analytics we recommend that you read our complete guide here.