
14/12/2013, 10:14
|
| | Fecha de Ingreso: diciembre-2013
Mensajes: 1
Antigüedad: 11 años, 4 meses Puntos: 0 | |
Ver ip de visitantes de Magento en google analytics Alguien puede indicarme como añadir el siguiente código PHP para que aparezca en todas las páginas, en la plataforma Magento?
¿Que archivo debo modificar y donde debo añadirlo?
Aquí podéis ver la explicación de lo que hace este código.
http://www.danielpinero.com/como-ver-ip-visitante-google-analytics
<?php function getRealIpAddr() {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip=$_SERVER['HTTP_CLIENT_IP'];}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];} else {
$ip=$_SERVER['REMOTE_ADDR'];}
return $ip;} $ip = getRealIpAddr();
echo "<script type='text/javascript'>
_gaq.push(['_setCustomVar', 1, 'IP', '".$ip."', 1]); </script>"; ?> |