Antworten auf deine Fragen:
Neues Thema erstellen

Script im Header - was bewirkt der?

Tannhaeuser

Stadtdurchstreifer

Hallo,
im Quelltext einer webseite habe ich diesen Code entdeckt:
Code:
<[SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]script[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]type[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]="text/javascript">
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]var[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] _gaq = _gaq || [];
_gaq.push([[/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]'_setAccount'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]'UA-32836511-1'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]]);
_gaq.push([[/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]'_trackPageview'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]]);
([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]function[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]() {
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]var[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ga = document.createElement([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]'script'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]); ga.type = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]'text/javascript'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]; ga.async = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
ga.src = ([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]'https:'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] == document.location.protocol ? [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]'https://ssl'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] : [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]'http://www'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) + [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]'.google-analytics.com/ga.js'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]var[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] s = document.getElementsByTagName([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]'script'[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[0]; s.parentNode.insertBefore(ga, s);
})();
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]script[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]>
[/COLOR][/SIZE][/COLOR][/SIZE]
Kann mir jemand erklären, was der Code bewirkt?
Danke
 

Myhar

Hat es drauf

AW: Script im Header - was bewirkt der?

Das ist der Code für google Analytics. Es erstellt ein script-Tag und hängt dieses im Head der Seite ein. Dabei wird abgefragt, ob http/https/.. verwendet werden soll.
Das ist alles.
 
Bilder bitte hier hochladen und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Antworten auf deine Fragen:
Neues Thema erstellen

Willkommen auf PSD-Tutorials.de

In unseren Foren vernetzt du dich mit anderen Personen, um dich rund um die Themen Fotografie, Grafik, Gestaltung, Bildbearbeitung und 3D auszutauschen. Außerdem schalten wir für dich regelmäßig kostenlose Inhalte frei. Liebe Grüße senden dir die PSD-Gründer Stefan und Matthias Petri aus Waren an der Müritz. Hier erfährst du mehr über uns.

Stefan und Matthias Petri von PSD-Tutorials.de

Nächster neuer Gratisinhalt

03
Stunden
:
:
25
Minuten
:
:
19
Sekunden

Neueste Themen & Antworten

Flatrate für Tutorials, Assets, Vorlagen

Zurzeit aktive Besucher

Statistik des Forums

Themen
118.565
Beiträge
1.538.067
Mitglieder
67.488
Neuestes Mitglied
Andrew56524
Oben