Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Watheq's avatar
Level 14

I can't use spatie / laravel-analytics after setting up my Google analytics

I have followed the Spatie documentation but I get this error message. Although I have copied the client email from the service_account-credentials file to my google analytics user and granted it the admin role.

the error message:

{ "error": { "code": 403, "message": "User does not have sufficient permissions for this profile.", "errors": [ { "message": "User does not have sufficient permissions for this profile.", "domain": "global", "reason": "insufficientPermissions" } ] } } (View: /Users/watheq/Sites/htdocs/LapRadiologyWeb/resources/views/dashboard.blade.php)
0 likes
2 replies
muathye's avatar
muathye
Best Answer
Level 41

Please make sure that you enabled the Google Analytic API

This is blog about integration laravel with google cloud analytics

https://codelapan.com/post/google-analytics-laravel

Create Universal Analytics only like image below https://camo.githubusercontent.com/085984d0230c923ec51fec0e35d520a6614d9c25c3829d3b3279fde36b872068/68747470733a2f2f7370617469652e6769746875622e696f2f6c61726176656c2d616e616c79746963732f76342f362e706e67

Please , refer to this offical documentation https://cloud.google.com/appengine/docs/flexible/php/integrating-with-analytics

You will find a link choose PHP code.

2 likes
Watheq's avatar
Level 14

@muathye yes it works.

But I hope they make support for the new Google 4 ِِAnalytics because Universal Analytics will be stopped in 2023.

1 like

Please or to participate in this conversation.