I need to create a script (php for example) to generate new sites on a google analytics account.
I need to obtain the ID of the generated site.
¿It is possible to do it? How can i achieve it?
Thanks
No. All of the Google Analytics APIs are read-only. The only way to create new accounts is manually.
As @jk added below, from the Google Analytics Management API docs:
Google Analytics provides developer access to the configuration data through the Management API, which is a read-only API for account and configuration data.