Forum Moderators: coopster

Message Too Old, No Replies

Translate JavaScript into PHP

Can Google Analytics be translated into PHP?

         

smallcompany

2:46 am on Feb 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is it possible to translate regular Google Analytics JavaScript code into PHP so it can be triggered from inside PHP redirect script before header location?

Thanks

whoisgregg

7:15 pm on Feb 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is not possible. I tried finding a way to do this a month or two back and had no luck. For my particular need (tracking outbound clicks even though they passed through a PHP redirect script) I found a different approach that worked for me, but I don't know if it'd be helpful for anyone else.

Basically, since I was using PHP to output the links anyway, I added this onclick handler to track the click event:

onclick="javascript:pageTracker._trackPageview('/outgoing/example.com/somepage.html');"

Google describes this method here [google.com].

smallcompany

4:00 am on Feb 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks.

I know that way, but what do you do if you have 300 pages and 5 links per page on average? How to maintain all that man? We need something automated...

Some people said Ajax, but I have no clue about it.