PHP code example of dejurin / lametric-adsense

1. Go to this page and download the library: Download dejurin/lametric-adsense 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/ */

    

dejurin / lametric-adsense example snippets




= new \Dejurin\LaMetric_Adsense([
    'clientId' 	=> '', // Google Client Id 
    'clientSecret' => '', // Google Client Secret
    'redirectUri' => 'http://localhost:8000/'.basename(__FILE__).'?auth',
    'accessType' => 'offline',
],
'', // La Metric: Access Token
'', // La Metric: URL for pushing data to all 
__DIR__.'/db', // DB path
basename(__FILE__) // current filename
);

if (isset($_GET['auth'])) {
    $LMA->auth();
} elseif (isset($_GET['accounts'])) {
    $LMA->accounts();
} elseif (isset($_GET['show'])) {
    $LMA->show();
} elseif (isset($_GET['push'])) {
    $LMA->push();
} else {
	$LMA->index();
}