{"repo":"pirsch-analytics/laravel-pirsch","free":true,"listed":false,"github":"https://github.com/pirsch-analytics/laravel-pirsch","clone":"git clone https://github.com/pirsch-analytics/laravel-pirsch.git","description":"Official Laravel integration for Pirsch Analytics.","language":"PHP","stars":50,"topics":["laravel","analytics","php"],"license":"MIT","category":"analytics","readme_excerpt":"Pirsch for Laravel This package is the official Laravel integration for Pirsch Analytics. Installation 1. Install this package: 2. Add the Pirsch access token to your .env file. Leave it empty in non-production environments to disable tracking: 1. Visit the Pirsch \"Integration\" settings page. 2. Make sure the correct domain is selected in the top left corner of the page. 3. Scroll down to the \"Clients\" section and press the \"Add Client\" button. 4. Select \"Access Key (write-only)\" as type and enter a description. 5. Press the \"Create Client\" button and copy the generated \"Client secret\". 6. Add the copied token to your .env file: Usage Track pageviews Automatically This package comes with a TrackPageview middleware that allows you to track pageviews automatically. Apply the middleware to your web routes by appending it in the withMiddleware method in your bootstrap/app.php file: You can also apply the middleware to specific routes or groups: Manually If you want to manually track pageviews instead, you can use the Pirsch::track() method. Calling this method without any arguments will track a pageview for the current HTTP request: Track events Pirsch allows you to track custom events in order to measure additional information. You can use the Pirsch::track() method with a name and optional metadata to track an event: Filter pages You can configure the TrackPageview middleware to exclude specific pages from being tracked. On a specific rouute, you can exclude pages by adding a e","default_branch":null,"files":null,"tree":[],"storefront":"/r/pirsch-analytics","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pirsch-analytics/laravel-pirsch/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}