on shared webhosting you can't do much if php is run as apache module and not as cgi.
you have to leave the g2data folder writable by the webserver user.
and if the webhost doesn't setup proper open_basedir restrictions or allows also other scripting languages (e.g. perl), you can't prevent other accounts on the same host from deleting / modifying your g2data folder.
it doesn't even need a malicious account owner on this webhost, all it needs is a single, vulnerable script that is installed on this server, and someone could exploit this script and delete / copy data from every account user on this shared webhost.
most webhosts configure the php open_basedir correctly, which is already a reasonable improvement in security if only php scripts are run on this host.
even better webhosts run php as fast-cgi + suexec + chroot jail and then you can make 100% sure that only you and noone else can read/write to your g2data folder / to your config.php .