Authentication Error using Google Sheets Import Script


I’ve been trying to connect Matomo to Google Data Studio as described in the FAQ:

However, when I try to import the data using the script provided in the article, I get the following error in google sheets:

Error: You can’t access this resource as it requires ‘view’ access for the website id = 5.

Here’s the Export URL I’ve been using:


It works when I give view access to the anonymous user. I’ve also created a new user and given them view access but I got the same error using their token.

I had the same mistake while convert my excel data to google sheets. I’ll recomend you to look on this step-by-step guide to understand how you can do this.