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.