could you give us the java code?
Although after you check them out I have a feeling you'll agree.
the source code provided by GA is this
var _gaq = _gaq || ;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script'); s.parentNode.insertBefore(ga, s);
I simply copied and pasted in my .html pages without changing anything and keeping the extension as .html.
Then I added the line to set a custom variable and it was not working because, you said, it is a PHP code but I am confused because it seems to me that they are using the same language...
Anyway, I tried to save all my pages as .php but I surely missed something because it did not work (i.e. tha pages did not upload coorectly). I probably re-try and take a look to the links you sent me
thanks a lot!
The part where it says <?php ... ?> tells the browser that your page has some PHP code in it (the part between those two 'tags'), which is why you need to rename it from .html to .php.
How are you uploading the pages to your server, with an FTP program? You may need to set it's upload mode to "Auto" before uploading the files if it's not already (usually is by default).
I whipped up a test page using your GA ID number and pasted exactly what I had on the first page, I just added your GA ID. Grab it here, and upload it to your server, then just navigate to: http://your-site.com/ga-test.php. View the source code to it and see if you spot an IP address in the code, if you do it's working. Also, read the short instructions I put on it. Lemme know how it turns out.
I upload the page as .php and when I opne the source code I actually spot an IP adress. However, when I go to
it says 'sorry but the page does not exist' and the IP still does not appear on GA.
I do not know if I am doing everything right...
However, when I go to
it says 'sorry but the page does not exist'
Might seem like a stupid question, but are you replacing "your-site.com" in that URL with your own actual site name? If you just go to the exact URL I gave you'd get a page doesn't exist error.
Sorry, when I go to the page you suggest it's actually showing the text you put on it...
but still no IP on GA (((
When you load up the page and see that text I put, view the page's source code and look for an IP address in the Google Analytics code, if it shows, it's working. Also, be sure to give it at least 24 hours since going to the page. GA is kinda slow with that.
Now the IP is appearing!
however, these IP adresses are the ones that have visited the page saved as .php?
I will try to re-upload all the pages as .php, but I don't understand why the last time my server was not able to correctly upload the pages...I just have to change the extension of pages and and the other files saved normally as .html, is it right? such as index.html? and also sitemap.xml and feed.xml?
thanks a lot!
I just have to change the extension of pages and and the other files saved normally as .html, is it right? such as index.html? and also sitemap.xml and feed.xml?
I still have a further question
in the test page you uploaded for me you wrote
['_setCustomVar', 1, 'IP', "(Mod note: IP Removed)", 2]
_gaq.push(['_setCustomVar', 1, 'IP', "<?php echo $_SERVER['REMOTE_ADDR']; ?>", 2]);
should I then replace what you wrote in all my pages or can I use the original line code? your line is associated to a specific IP...