I wonder that this works… Nextcloud and Piwik side by side on same Domain? Just a rough Guess: I would suggest to use different domains or at least subdomains like piwik.anydomain.com / nextcloud.anydomain.com.
I have the same problem. I have created a subdomain and want to track my nextcloud. I installed the app from the store and entered it as URL //piwik.mydomain.com
Unfortunately it does not work.
I am using nginx as Webserver on Ubuntu 16.04 LTS