### Install package with Composer Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Installs the package via Composer. ```bash composer require jeffersongoncalves/laravel-adobe-analytics ``` -------------------------------- ### Get report suites Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Retrieve the list of report suites using the AdobeAnalytics facade. ```php use JeffersonGoncalves\AdobeAnalytics\Facades\AdobeAnalytics; $reportSuites = AdobeAnalytics::reportSuites(); ``` -------------------------------- ### Get metrics for a report suite Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Get metrics for a specific report suite identified by its rsid. ```php $metrics = AdobeAnalytics::metrics('mysiterunsid'); ``` -------------------------------- ### Get dimensions for a report suite Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Get dimensions for a specific report suite identified by its rsid. ```php $dimensions = AdobeAnalytics::dimensions('mysiterunsid'); ``` -------------------------------- ### Get segments (all or by report suite) Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Retrieve all segments or segments for a specific report suite. The first call returns all segments, the second filters by the given rsid. ```php // All segments $segments = AdobeAnalytics::segments(); // Segments available to a specific report suite $segments = AdobeAnalytics::segments('mysiterunsid'); ``` -------------------------------- ### Publish config file Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Publishes the package configuration file. ```bash php artisan vendor:publish --tag=adobe-analytics-config ``` -------------------------------- ### Run a report Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Run a report with specified report suite, date range, metrics, and optional dimension. The dimension parameter is optional. ```php $report = AdobeAnalytics::runReport( rsid: 'mysiterunsid', startDate: '2026-01-01', endDate: '2026-01-31', metrics: ['metrics/visits', 'metrics/pageviews'], dimension: 'variables/page', // optional ); ``` -------------------------------- ### Run tests with composer test Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Runs the test suite for this Laravel package. Use this command to execute all tests defined in the project. ```bash composer test ``` -------------------------------- ### Configure Adobe Analytics package Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Configuration file for the Laravel Adobe Analytics package. Set environment variables for client ID, secret, company ID, access token, scope, and token safety margin. ```php // config/adobe-analytics.php return [ 'client_id' => env('ADOBE_CLIENT_ID', ''), 'client_secret' => env('ADOBE_CLIENT_SECRET', ''), 'company_id' => env('ADOBE_COMPANY_ID', ''), 'access_token' => env('ADOBE_ACCESS_TOKEN'), 'scope' => env('ADOBE_SCOPE', 'openid,AdobeID,additional_info.projectedProductContext,read_organizations,additional_info.roles'), 'token_safety_margin' => env('ADOBE_TOKEN_SAFETY_MARGIN', 60), ]; ``` -------------------------------- ### Set OAuth environment variables Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Environment variables for OAuth Server-to-Server authentication. The package exchanges these for an access token on first use, caches it, and refreshes it on expiry. ```env ADOBE_CLIENT_ID=your-client-id ADOBE_CLIENT_SECRET=your-client-secret ADOBE_COMPANY_ID=your-global-company-id ``` -------------------------------- ### Set static access token environment variables Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Environment variables for static access token authentication. When ADOBE_ACCESS_TOKEN is set, it is used as-is on every request and ADOBE_CLIENT_ID/ADOBE_CLIENT_SECRET are not required. ```env ADOBE_ACCESS_TOKEN=your-precomputed-access-token ADOBE_COMPANY_ID=your-global-company-id ``` -------------------------------- ### Handle AdobeAnalyticsException Source: https://github.com/jeffersongoncalves/laravel-adobe-analytics/blob/main/README.md Handle non-2xx API responses, including OAuth token failures. The exception exposes the decoded error body via errorBody(). ```php use JeffersonGoncalves\AdobeAnalytics\Exceptions\AdobeAnalyticsException; try { AdobeAnalytics::dimensions('invalid-rsid'); } catch (AdobeAnalyticsException $e) { logger()->error($e->getMessage(), $e->errorBody()); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.