Setting piwik URL based on environment in single page application

How can we setup piwik url based on environment(development, production…).

Hi,

The Piwik URL is just a normal Javascript variable, so you can just set it depending on which environment you are in.

I am doing it like this on my website: