{"id":18794550,"url":"https://github.com/effectra/tracker","last_synced_at":"2025-12-29T18:30:13.404Z","repository":{"id":197194763,"uuid":"698179919","full_name":"effectra/tracker","owner":"effectra","description":"Effectra Tracker is a PHP package that provides methods to extract information from the client's request, including IP address, browser details, operating system, device type, accepted languages, and referer URL. It also includes integration with IP tracking services to fetch additional attributes related to the provided IP address.","archived":false,"fork":false,"pushed_at":"2023-09-29T10:45:48.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-12-29T16:34:02.810Z","etag":null,"topics":["geolocation","guzzlehttp","http-client","php","psr","psr7-http","tracker","useragent"],"latest_commit_sha":null,"homepage":"https://www.effectra.com/package/tracker","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/effectra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-29T10:38:09.000Z","updated_at":"2024-04-09T12:53:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a9091f5-61e8-491c-8266-cfc43a284d68","html_url":"https://github.com/effectra/tracker","commit_stats":null,"previous_names":["effectra/tracker"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Ftracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Ftracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Ftracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effectra%2Ftracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/effectra","download_url":"https://codeload.github.com/effectra/tracker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239718702,"owners_count":19685798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geolocation","guzzlehttp","http-client","php","psr","psr7-http","tracker","useragent"],"created_at":"2024-11-07T21:29:44.984Z","updated_at":"2025-12-29T18:30:13.337Z","avatar_url":"https://github.com/effectra.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Effectra Tracker\n\nEffectra Tracker is a PHP package that provides methods to extract information from the client's request, including IP address, browser details, operating system, device type, accepted languages, and referer URL. It also includes integration with IP tracking services to fetch additional attributes related to the provided IP address.\n\n## Installation\n\nYou can install the Effectra Tracker package via [Composer](https://getcomposer.org/):\n\n```bash\ncomposer require effectra/tracker\n```\n\n## Usage\n\n### Tracker Class\n\n#### Initialize Tracker\n\n```php\nuse Effectra\\Tracker\\Tracker;\nuse Psr\\Http\\Message\\ServerRequestInterface;\n\n$request = ...; // Your PSR-7 ServerRequestInterface implementation\n$tracker = new Tracker($request);\n```\n\n#### Get Client's IP Address\n\n```php\n$ipAddress = $tracker-\u003egetIp();\n```\n\n#### Get Browser Details\n\n```php\n$browser = $tracker-\u003egetBrowser();\n// $browser['name'] contains the browser name\n// $browser['version'] contains the browser version\n```\n\n#### Get Operating System Details\n\n```php\n$os = $tracker-\u003egetOs();\n// $os['name'] contains the OS name\n// $os['version'] contains the OS version\n```\n\n#### Get Device Type\n\n```php\n$deviceType = $tracker-\u003egetDevice();\n```\n\n#### Get User Agent\n\n```php\n$userAgent = $tracker-\u003egetUserAgent();\n```\n\n#### Get Accepted Languages\n\n```php\n$acceptedLanguages = $tracker-\u003egetAcceptLangs();\n```\n\n#### Get Referer URL\n\n```php\n$refererUrl = $tracker-\u003egetReferer();\n```\n\n#### Check if Client is Using a Phone Device\n\n```php\n$isPhone = $tracker-\u003eisPhone();\n```\n\n#### Get All Client Information\n\n```php\n$clientInfo = $tracker-\u003egetAll();\n// $clientInfo is an associative array containing all client information\n```\n\n### IP Tracking Services Integration\n\nEffectra Tracker supports integration with various IP tracking services. Currently, the following services are supported:\n\n#### IpGeoLocation Service\n\n```php\nuse Effectra\\Tracker\\Services\\IpGeoLocation;\nuse GuzzleHttp\\Client;\n\n$client = new Client(); // GuzzleHttp client instance\n$ip = ...; // IP address to query\n$apiKey = ...; // Your API key for ipgeolocation.io\n\n$ipGeoLocation = new IpGeoLocation($client, $ip, $apiKey);\n$ipAttributes = $ipGeoLocation-\u003egetAll();\n```\n\n#### IpRegistry Service\n\n```php\nuse Effectra\\Tracker\\Services\\IpRegistry;\nuse GuzzleHttp\\Client;\n\n$client = new Client(); // GuzzleHttp client instance\n$ip = ...; // IP address to query\n$apiKey = ...; // Your API key for ipregistry.co\n\n$ipRegistry = new IpRegistry($client, $ip, $apiKey);\n$ipAttributes = $ipRegistry-\u003egetAll();\n```\n\n#### IpWhoIs Service\n\n```php\nuse Effectra\\Tracker\\Services\\IpWhoIs;\nuse GuzzleHttp\\Client;\n\n$client = new Client(); // GuzzleHttp client instance\n$ip = ...; // IP address to query\n\n$ipWhoIs = new IpWhoIs($client, $ip, null); // No API key required for ipwho.is\n$ipAttributes = $ipWhoIs-\u003egetAll();\n```\n\n## Requirements\n\n- [PSR-7 HTTP Message](https://www.php-fig.org/psr/psr-7/)\n- [Guzzle HTTP Client](https://docs.guzzlephp.org/en/stable/)\n- [Effectra HTTP Foundation](https://github.com/effectra/http-foundation)\n\n## Author\n\n- **Mohammed Taha** - [Email](mailto:info@mohammedtaha.net)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffectra%2Ftracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feffectra%2Ftracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffectra%2Ftracker/lists"}