Google Analytics

Please report bugs here!

Moderator: Thorsten

Post Reply
com
Posts: 184
Joined: Wed May 04, 2005 12:41 am

Google Analytics

Post by com »

Hallo!

Seit der neuen Version von phpmyfaq.de habe ich das Problem, dass der Code (Google Anayltics) nicht korrekt mehr auf den Server geladen werden kann. Deshalb werden keine Seiten mehr getracked.....

Kann mir hier wer helfen?

Danke, Jessy
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Google Analytics

Post by Thorsten »

Hi,

seit welcher Version genau? Google Analytics ist doch nur JavaScript Code, den man in die index.tpl kopieren kann...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
com
Posts: 184
Joined: Wed May 04, 2005 12:41 am

Re: Google Analytics

Post by com »

Hallo!

Bei der aktuellsten Version passiert mir immer folgendes: Sobald ich den Google Analytics Code:

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXXX-1");
pageTracker._trackPageview();
} catch(err) {}</script>

...in die index.tpl einpflege und hochlade - sieht der Code (im Quelltext der Startseite) so aus:

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push();
_gaq.push();
_gaq.push();
_gaq.push();

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
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);
})();

</script>

Kann mir hier wer helfen?

Danke, Jessy
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Google Analytics

Post by Thorsten »

Hi,

kannst du mir den Code mal per Mail senden? Dann kann ich das testen.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
com
Posts: 184
Joined: Wed May 04, 2005 12:41 am

Re: Google Analytics

Post by com »

Hallo Thorsten!

Vielen Dank, Email an dich ging soeben raus....

Viele Grüsse!

Jessy
pommesfritz
Posts: 17
Joined: Mon Mar 01, 2010 2:59 pm

Re: Google Analytics

Post by pommesfritz »

Hallo,

habe das selbe Problem

Der Code den ich in die index.tpl einfüge:

Code: Select all

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-xxxxxxx-x']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
wird im Quelltext auf der Startseite zu:

Code: Select all

<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push();
  _gaq.push();
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    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);
  })();
</script>
setAccount und trackPageView wird also irgendwie verschluckt.. woran liegt das ?

Übrigens funktioniert das nur so, wenn ich den code am ende unter dem gesamten content einfüge. am ende des <head> tags (wo es empfohlen wird zu plattzieren) verreisst es mir die gesamte seite...
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Google Analytics

Post by Thorsten »

Hi,

versuch mal statt

Code: Select all

_gaq.push(['_setAccount', 'UA-xxxxxxx-x']);
das hier

Code: Select all

_gaq.push(["_setAccount", "UA-xxxxxxx-x"]);
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
pommesfritz
Posts: 17
Joined: Mon Mar 01, 2010 2:59 pm

Re: Google Analytics

Post by pommesfritz »

Leider keine Verbesserung :/
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Google Analytics

Post by Thorsten »

Hi,

ich denke, ich hab die Stelle gefunden, wo das passiert... ich überlege mir eine Lösung.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
pommesfritz
Posts: 17
Joined: Mon Mar 01, 2010 2:59 pm

Re: Google Analytics

Post by pommesfritz »

Hi,

hast du schon eine Lösung?

Gruß
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Google Analytics

Post by Thorsten »

Hi,

leider noch nicht...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
pommesfritz
Posts: 17
Joined: Mon Mar 01, 2010 2:59 pm

Re: Google Analytics

Post by pommesfritz »

Hi,

und jetzt? ;)

Gruß
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Google Analytics

Post by Thorsten »

Hi,

der Bug ist noch für die 2.6.8 offen, steht auf meiner TODO!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Google Analytics

Post by Thorsten »

Hi,

ich hab doch nun endlich den Bug gefunden und gefixt. Hier sind die Patches:

http://github.com/thorsten/phpMyFAQ/com ... ed729e5dcd
http://github.com/thorsten/phpMyFAQ/com ... 547b092434

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply