Programare & stuff > Programare
Cum activezi google analytics in php
(1/1)
Admin:
Paginile tale trebuie sa contina sectiunea head
Astfel ca ultima linie de la head, inainte de </head> faci un echo astfel:
echo '<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxx"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag("js", new Date()); gtag("config", "UA-xxxx");</script>';
UA-xxxx este codul pe care-l obtii in pagina analytics din google.
Poti testa functionalitatea din pagina analytics -> real time.
Navigare
Du-te la versiunea completă