//******************************************************************** // // Copyright (c) 2008 MindLab GmbH // All rights reserved. // //==================================================================== // // Project : Spiegel Online // Filename : nm_tr_remote.js // //==================================================================== // /** * @file * This script can be used to implement a pixeltracking on your website * * @author $Felix Engemann$ * @version $0.0.1$ * @date $31.08.2006$ *@listofchanges cha adaption for postbank help-div 2007/09/07 *@listofchanges cha adaption for postbank clientStat tracking Pixelhelp-div 2007/11/13 *@listofchanges cha adaption for postbank clientStat tracking Pixelhelp-div 2007/11/16 *@listofchanges asc generalisation for netmind 4.0 release 2007/12/10 *@listofchanges uha Anpassung Spon, kein Tracking JS, da Tracker Cookie genutzt wird */ // //******************************************************************** //******************************************************************** //config Object //******************************************************************** function cConfigPixel() { //----------------------------------------------------- // members //----------------------------------------------------- //set to true, if you want to get the params automatically this.m_bAutoparams = true; //set to true, if you want to send the pixel automatically this.m_bAutosend = true; //The protocol to use for getting the pixel, could be either http //or https this.m_strPixelProtocol = location.href.substr(0, location.href.indexOf(":")); //the servername to get the pixel from (no protocol here, and //no path here), you can append a port or prepend an authendication //like: user:passwort@myserver.mydomain.com:12345 //where "user:password@" is the authentication // "myserver.mydomain.com" is the fully qualified servername // ":12345" is a port-Number this.m_strPixelServer = (this.m_strPixelProtocol == "https" ? "count.spiegel.de" : "c.spiegel.de"); //the path to request from the given server, this path could of //course include CGI-Parameters //example: "/mywebbug?thisismyparameter=value" this.m_strPixelPath = "/nm_trck.gif"; //Send Url by default this.m_bSendUrl = true; //Send Referrer by default this.m_bSendReferrer = true; //Send MetaTags by default this.m_bSendMetaTags = true; //Send Browser Setting, Screen Infos etc. this.m_bSendTech = false; //Send Browser Setting, Screen Infos etc. this.m_bSendUrlHash = true; //-------------------------------------------------------- // metatags to be parsed //-------------------------------------------------------- this.m_aMetatag = new Array( "sp.*" ); //-------------------------------------------------------- // Hasht parameter to be parsed //-------------------------------------------------------- this.m_aHashParameter = new Array( "ref", "from" ); } // end class cConfigPixel //========================================================== // getAutoParams //========================================================== function config_getSendUrlHash () { return this.m_bSendUrlHash; } //========================================================== // getAutoParams //========================================================== function config_getAutoParams () { return this.m_bAutoparams; } //========================================================== // getAutoSend //========================================================== function config_getAutoSend () { return this.m_bAutosend; } //========================================================== // getPixelUrl //========================================================== function config_getPixelUrl () { return this.m_strPixelProtocol+"://"+this.m_strPixelServer + this.m_strPixelPath; } //========================================================== // getSendUrl //========================================================== function config_getSendUrl () { return this.m_bSendUrl; } //========================================================== // getSendReferrer //========================================================== function config_getSendReferrer () { return this.m_bSendReferrer; } //========================================================== // getSendMetatags //========================================================== function config_getSendMetatags () { return this.m_bSendMetaTags; } //========================================================== // getSendTech //========================================================== function config_getSendTech () { return this.m_bSendTech; } //========================================================== //Definition of Prototypes //========================================================== //methoden zur Klasse hinzufuegen cConfigPixel.prototype.getAutoParams = config_getAutoParams; cConfigPixel.prototype.getAutoSend = config_getAutoSend; cConfigPixel.prototype.getPixelUrl = config_getPixelUrl; cConfigPixel.prototype.getSendUrl = config_getSendUrl; cConfigPixel.prototype.getSendUrlHash = config_getSendUrlHash; cConfigPixel.prototype.getSendReferrer = config_getSendReferrer; cConfigPixel.prototype.getSendMetatags = config_getSendMetatags; cConfigPixel.prototype.getSendTech = config_getSendTech; //******************************************************************** //Pixel-Object //******************************************************************** //Contstructor for Pixel-Object function cRemotePixel(oConfig) { //----------------------------------------------------- // members //----------------------------------------------------- //pixel object constructor //this.m_oImage = new Image(); this.m_arParameterList = new Array(); this.m_nParameterCount = 0; this.m_strPixelURL = oConfig.getPixelUrl(); //Configuration this.m_oConfig = oConfig; this.hasMetatagParams = false; }//end function cRemotePixel() //========================================================== //methode fuer Objekt Pixel: Fuegt einen Parameter hinzu //========================================================== function remotepixel_addParameter(key, value) { arPair = new Array(key, value); this.m_arParameterList[this.m_nParameterCount] = arPair; this.m_nParameterCount++; }//end function pixel_add_parameter() //========================================================== //method for object Pixel: add affiliate //========================================================== function remotepixel_addAffiliate(name) { this.addParameter("affiliate", name) }//end function remotepixel_addAffiliate(name) //========================================================== //method for object Pixel: add url //========================================================== function remotepixel_addUrl() { this.addParameter("url", document.URL); }//end function remotepixel_addAffiliate(name) //========================================================== //method for object Pixel: add referrer //========================================================== function remotepixel_addReferrer() { this.addParameter("referrer", document.referrer); }//end function remotepixel_addAffiliate(name) //========================================================== //methode fuer Objekt Pixel: senden des Pixels //========================================================== function remotepixel_sendData() { strURL = this.m_strPixelURL+"?"; for(i=0; i0) strURL += "&"; strURL += escape(this.m_arParameterList[i][0])+"="+escape(this.m_arParameterList[i][1]); }//end for(i=0; i0) strURL += "&"; strURL += escape(oNMRemotePixel.m_arParameterList[i][0])+"="+escape(oNMRemotePixel.m_arParameterList[i][1]); } document.write("") } }