{"id":17477458,"url":"https://github.com/capevace/pan-analytics-viewer","last_synced_at":"2026-04-07T14:02:21.714Z","repository":{"id":258222136,"uuid":"874489652","full_name":"Capevace/pan-analytics-viewer","owner":"Capevace","description":"A tiny package to view your panphp/pan analytics right in the UI where they are triggered!","archived":false,"fork":false,"pushed_at":"2024-10-18T01:54:50.000Z","size":36,"stargazers_count":71,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T01:09:21.684Z","etag":null,"topics":["analytics","developer-tools","laravel","laravel-package","panphp","php","user-interface"],"latest_commit_sha":null,"homepage":"","language":"Blade","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Capevace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-17T23:28:51.000Z","updated_at":"2025-03-02T02:37:48.000Z","dependencies_parsed_at":"2024-10-18T03:24:29.875Z","dependency_job_id":"819cae17-539d-4cec-911f-a7ea3dbc43c9","html_url":"https://github.com/Capevace/pan-analytics-viewer","commit_stats":null,"previous_names":["capevace/pan-analytics-viewer"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Capevace%2Fpan-analytics-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Capevace%2Fpan-analytics-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Capevace%2Fpan-analytics-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Capevace%2Fpan-analytics-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Capevace","download_url":"https://codeload.github.com/Capevace/pan-analytics-viewer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246193270,"owners_count":20738452,"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":["analytics","developer-tools","laravel","laravel-package","panphp","php","user-interface"],"created_at":"2024-10-18T20:08:08.135Z","updated_at":"2026-04-07T14:02:21.662Z","avatar_url":"https://github.com/Capevace.png","language":"Blade","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg  alt=\"Screenshot of the popup\" src=\"https://github.com/user-attachments/assets/3d8142bc-c781-43f7-bb90-741939b7cbd9\" style=\"width: 100%\"\u003e\n\n\u003cbr\u003e\u003cbr\u003e\n\n\n# `mateffy/pan-analytics-viewer`\n\n### A tiny Laravel package to view your [panphp/pan](https://github.com/panphp/pan) analytics directly in the UI where they are triggered!\n\n\u003cbr\u003e\u003cbr\u003e\n\n\n\u003cdetails open\u003e\n        \u003csummary\u003eVideo Example\u003c/summary\u003e\n        \n[Video Example](https://github.com/user-attachments/assets/69aeac75-91b7-4005-a5f1-5923f3018964)\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n## Installation\n\n```bash\ncomposer require mateffy/pan-analytics-viewer\n```\n\n\u003cbr\u003e\n\n## Usage\n\nTo add the popups to your app, all you have to do is include the `pan-analytics::viewer` component in your blade template:\n\n```blade\n{{--    Make sure to verify who has access! \n        Including this component will expose your analytics data!    --}}\n\n@if (auth()-\u003euser()?-\u003eemail === 'admin@example.com')\n    \u003cx-pan-analytics::viewer /\u003e\n@endif\n```\n\nThe popups should now be appearing when hovering over elements that have a `[data-pan]` attribute.\n\n### Options\n\nYou can pass options to the component to change the default behavior:\n\n```blade\n\u003cx-pan-analytics::viewer\n    :toggle=\"true\"\n    :events=\"['my-event-1', 'my-event-2']\"\n    :force-all=\"true\"\n/\u003e\n```\n\n| Option      | Description                                                                                  | Default |\n|-------------|----------------------------------------------------------------------------------------------|---------|\n| `toggle`    | Whether to show a toggle button to show/hide the popups                                      | `false` |\n| `events`    | Specify the events that should be fetched.                                                   | `null`  |\n| `force‑all` | Force all events to get fetched, may be required when dynamically creating tracked elements. | `false` |\n\n### Events\n\nThe package will automatically detect what events are being tracked on the current page by querying for `data-pan` attributes. If you are dynamically creating tracked elements after initial render, these may be missed and no popup will be shown.\n\nTo fix this, you can either specify the specific `events` you want to show on the page or use the `force-all` option to disable filtering and fetch all events.\n\n\u003cbr\u003e\n\n## Security\n\nThe package registers a route for the client to be able to access the data. This route required a valid URL signature to be able to access it, which the `pan-analytics::viewer` component will automatically generate (signed URLs are valid for 1h). **If you include this component on a page that is publicly accessible and don't check the user before including the component, anyone can access the analytics data!**\n\nSo, make sure to only render this component for users with the necessary permissions.\n\n```blade\n@if (auth()-\u003euser()?-\u003eemail === 'admin@example.com')\n    \u003cx-pan-analytics::viewer /\u003e\n@endif\n\n{{-- or --}}\n\n@if (auth()-\u003euser()?-\u003ecan('view-analytics'))\n    \u003cx-pan-analytics::viewer /\u003e\n@endif\n```\n\n### Tippy.js\n\nThis package uses [Tippy.js](https://github.com/atomiks/tippyjs) to create the popups. `tippy.js` is included via `unpkg.com` like this, but only when the component is rendered:\n\n```html\n\u003cscript src=\"https://unpkg.com/@popperjs/core@2\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/tippy.js@6\"\u003e\u003c/script\u003e\n```\n\n\u003cbr\u003e\n\n## Configuration\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --provider=\"Mateffy\\PanAnalyticsViewer\\PanAnalyticsViewerServiceProvider\" --tag=\"config\"\n```\n\nThis is the default configuration:\n\n```php\nreturn [\n    'endpoint' =\u003e env('PAN_ANALYTICS_ENDPOINT', '/pan/viewer')\n];\n```\n\n### Endpoint\n\nYou can change the URL that the analytics are being exposed on by changing the `PAN_ANALYTICS_ENDPOINT` environment variable or customizing the `endpoint` config key. The default URL is `example.com/pan/viewer`.\n\n\u003cbr\u003e\n\n## Changelog\n\n- 1.0.2\n  - Feature: added Livewire support, the `[data-pan]` search will now be re-run after Livewire `morph.updated` events are fired, to show the popups for newly created elements\n- 1.0.1\n  - Fix: removed livewire specific script inclusion\n- 1.0.0 \n  - Initial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapevace%2Fpan-analytics-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapevace%2Fpan-analytics-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapevace%2Fpan-analytics-viewer/lists"}