PHP code example of jpikowski / criteo-mapi-php-client

1. Go to this page and download the library: Download jpikowski/criteo-mapi-php-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jpikowski / criteo-mapi-php-client example snippets

 bash
composer 
 php
 php
riteo = new Criteo_MAPI( 'username', 'password' );
 php
$criteo->getCampaignsByAdvertiser( '12345' );
 php
	$query = [
		'reportType' => 'CampaignPerformance',
		'advertiserIds' => '12345',
		'startDate' => '2019-01-15',
		'endDate' => '2019-01-16',
		'dimensions' => [
			'CampaignId',
			'AdvertiserId',
			'Day'
		],
		'metrics' => [
			'Clicks',
			'Displays'
		],
		'format' => 'csv',
		'currency' => 'USD',
		'timezone' => 'PST'
	];

$criteo->getStats($query, './reports/results.csv');