PHP code example of pmmotors / pm-analytics-package

1. Go to this page and download the library: Download pmmotors/pm-analytics-package 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/ */

    

pmmotors / pm-analytics-package example snippets



// use App\Api\Analytics\AdWords\AdWordsReportV2;
use PmAnalyticsPackage\api\AdWords\AdWordsReportV2;

class AdWordsReportMaserati extends AdWordsReportV2 {

    ...

}

$report = new AdWordsReportMaserati(
    $clientId,
    $startDate,
    $endDate,
    $accountName
);

$report->getReport();


// init al facebook configuration
Facebook::FacebookInit();

// add facebook account
$account = Facebook::FacebookAccount($account_id);

$facebookAd = new FacebookReport(
    $account,
    $startDate,
    $endDate,
    $accountName
);

$facebookAd->getDateFromFacebookAPI();

$dialog = new DialogTechReport(
    $reportStarDate,
    $reportEndDate,
    $accountName,
    $phoneNumberArr
);

$dialog->getDialogTechArray();

$dataSourcePath = 'path';

$analytics = Google::make('analytics');
$google = new GoogleAnalyticsReport(
    $analytics,
    $profileId,
    $reportDate,
    $accountName,
    $dataSourcePath
);

$google->getAnalyticsArray();

bash
    docker-compose exec php-apache bash