Jump to content

Umiejscowienie kodu Google Analytics


seofuture

Recommended Posts

Witajcie,

Presta 1,6. Korzystam ze standardowej wtyczki do osadzenia GA:

obraz.png.687efb28754f72a3db9f44268e08845f.png

Niestety kod się wstawian na samym końcu sekcji <head> a ja bym chciał, żeby to było na samym początku. W jaki sposób to przestawić? A może olać wtyczki i ręcznieto do pliku wstawić? Jeśli tak to do którego?

Z góry dziękuję za pomoc.

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

tak

z palca

themes/nazwa themes/header.tpl

na samym początku wstawiasz w literalu

<head>
    {literal}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxxxx"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-xxxxxxxx');
</script>

{/literal}

działa idealnie

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...