• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

phillika
#1 Posted : Wednesday, March 12, 2008 4:55:41 PM(UTC)
phillika

Rank: Member

Joined: 1/28/2008(UTC)
Posts: 14

I need to have a statistics/tracking javascript insert run on all my site pages (see script below). Where's the best place to put it? Should I insert the text directly into an aspx file or should I I call it with a "script" line? Where should the script line go? Help!


Thanks in advance,

Kenton






javascript<b> INSERT</b>



&lt;!--ONESTAT scriptCODE START--&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
// Account ID : ******

// Website URL: http://www.verlenes.com
// Copyright (C) 2002-2006 OneStat.com All Rights Reserved
function OneStat_Pageview()
{
var d=document;
var sid="******";
var CONTENTSECTION="";
var osp_ACTION="";
var osp_TRANSACTION="";
var osp_AMOUNT="";
var osp_PRODUCTCODE="";
var osp_PRODUCTGROUP="";
var osp_ADCAMPAIGN="";
var osp_CUSTOMER="";
var osp_CUST0 = "";
var osp_CUST1 = "";
var osp_CUST2 = "";
var osp_CUST3 = "";
var osp_CUST10 = "";
var osp_CUST11 = "";
var osp_URL=d.URL;
var osp_Title=d.title;
var t=new Date();
var p="http"+(d.URL.indexOf('https:')==0?'s':'')+"://stat.onestat.com/stat.aspx?tagver=2&amp;sid="+sid;
p+="&amp;url="+escape(osp_URL);
p+="&amp;ti="+escape(osp_Title);
p+="&amp;section="+escape(CONTENTSECTION);
p+="&amp;cma="+escape(osp_ACTION);
p+="&amp;cmt="+escape(osp_TRANSACTION);
p+="&amp;cmm="+escape(osp_AMOUNT);
p+="&amp;cmp="+escape(osp_PRODUCTCODE);
p+="&amp;cmg="+escape(osp_PRODUCTGROUP);
p+="&amp;cmad="+escape(osp_ADCAMPAIGN);
p+="&amp;cmc="+escape(osp_CUSTOMER);
p+="&amp;cu0="+escape(osp_CUST0);
p+="&amp;cu1="+escape(osp_CUST1);
p+="&amp;cu2="+escape(osp_CUST2);
p+="&amp;cu3="+escape(osp_CUST3);
p+="&amp;cu10="+escape(osp_CUST10);
p+="&amp;cu11="+escape(osp_CUST11);
p+="&amp;rf="+escape(parent==self?document.referrer:top.document.referrer);
p+="&amp;tz="+escape(t.getTimezoneOffset());
p+="&amp;ch="+escape(t.getHours());
p+="&amp;js=1";
p+="&amp;ul="+escape(navigator.appName=="Netscape"?navigator.language:navigator.userLanguage);
if(osp_URL!=d.URL) p+="&amp;ol="+escape(d.URL);
if(typeof(screen)=="object"){
p+="&amp;sr="+screen.width+"x"+screen.height;p+="&amp;cd="+screen.colorDepth;
p+="&amp;jo="+(navigator.javaEnabled()?"Yes":"No");
}
d.write('&lt;img id="ONESTAT_TAG" border="0" width="1" height="1" src="'+p+'" &gt;');
}

OneStat_Pageview();
//--&gt;
&lt;/script&gt;
&lt;noscript&gt;
&lt;a href="http://stat.onestat.com/stat.aspx?tagver=2&amp;amp;sid=359979&amp;amp;js=No&amp;amp;" ALT="OneStat.com Web Analytics"&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;!--ONESTAT scriptCODE END--&gt;
Cliff
#2 Posted : Wednesday, March 12, 2008 5:50:22 PM(UTC)
Cliff

Rank: Member

Joined: 5/24/2004(UTC)
Posts: 4,147

This thread may give you a head start on building a module for that, Kenton: http://forums.bvcommerce.com/de...lt.aspx?f=79&m=42170
MitchA
#3 Posted : Thursday, March 13, 2008 8:08:19 AM(UTC)
MitchA

Rank: Member

Joined: 3/3/2006(UTC)
Posts: 1,737

Kenton, I looked at Onestat. I found that I'm getting about the same info from my host. It's included in my hosting pkg.

I'd check with your host and see if they don't already offer this info.
Optimists invent airplanes,
Pessimists buy parachutes.
phillika
#4 Posted : Thursday, March 13, 2008 8:23:21 PM(UTC)
phillika

Rank: Member

Joined: 1/28/2008(UTC)
Posts: 14

Thanks. I may eventually switch to a different analytics package, but I'd like to keep using this in the near term for consistency purposes. I discovered that OneStat requires using a different code for ASP pages, but I still can't make it work. The ASP instructions are below, but I've tried this and it still doesn't work. I've pasted the code below (with my AccountID) in the Default.master and Home.master pages in the theme's folder and neither seems to work properly.


I have a line calling the subroutine, but when it runs, I get an error on the "&lt;%Sub WriteOneStatTag(strPagename)" line saying Method not allowed. I tried replacing the &lt;% with a script tag, and it gets me past the first line and requires me to declare strPagename, strURL and strAccountID (which I did) but it ultimately runs into a couple of different errors when it hits the javascript code. Any suggestions?

[3][/3]

[3][/3]

[3]
In this section we describe an extension of the overruling method as described above in the situation that you are using a server-side scripting technology (i.e. ASP, CGI, PHP, JSP or ColdFusion). The following examples are using the Microsoft Active Server Pages. When you develop a server-side[/3]<SPAN style="FONT-SIZE: 11pt; COLOR: black; FONT-FAMILY: Arial">function to generate the OneStat.com script code it is possible to re-use that function on every page of your website and provide the page-url as a parameter. The page-url parameter can be provided by a database or content management system or an other method. The output of the function is the complete script as provided by OneStat.com but generated by the server-side scripting technology. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

<SPAN style="FONT-SIZE: 11pt; COLOR: black; FONT-FAMILY: Arial">In the example below the lines in BOLD are the Microsoft ASP statements. <o:p></o:p>

<SPAN style="FONT-SIZE: 11pt; COLOR: black; FONT-FAMILY: Arial"><o:p> </o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black"><FONT face="Times New Roman">&lt;% <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">Sub WriteOneStatTag(strPagename) <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">Dim strURL <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">Dim strAccountID <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">strURL = "http://www.onestat.com/asp/" &amp; strPagename <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">strAccountID = "155454" <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">%&gt; <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;!--ONESTAT scriptCODE START--&gt; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;script LANGUAGE="javascript"&gt; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;!-- <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">// Modification of this code is not allowed and will permanently disable your account! <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">// SiteName: www.onedemostat.com <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">// Copyright (C) 2002-2005 OneStat.com All Rights Reserved <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">function OneStat_Pageview() <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">{ <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">var d=document; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">var sid="&lt;%=strAccountID%&gt;"; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">var CONTENTSECTION=""; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">var CUSTOMDATA=""; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;%if strPageName = "" then%&gt; <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">var osp_URL= d.URL; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;%else%&gt; <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">var osp_URL= "&lt;%=sURL%&gt;"; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;%end if%&gt; <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">var osp_Title= d.title; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">var t=new Date(); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">var p="http"+(document.URL.indexOf('https:')==0?'s':'')+"://stat.onestat.com/stat.aspx?tagver=2&amp;sid="+sid; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">p+="&amp;url="+escape(osp_URL); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">p+="&amp;ti="+escape(osp_Title); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">p+="&amp;section="+escape(CONTENTSECTION); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">p+="&amp;custom="+escape(CUSTOMDATA); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">p+="&amp;rf="+escape(parent==self?window.document.referrer:top.document.referrer); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">p+="&amp;tz="+escape(t.getTimezoneOffset()); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">p+="&amp;ch="+escape(t.getHours()); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">p+="&amp;js=1"; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">p+="&amp;ul="+escape(navigator.appName=="Netscape"?navigator.language:navigator.userLanguage); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">if(osp_URL!=d.URL) p+="&amp;ol="+escape(d.URL); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">if(typeof(screen)=="object"){ <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">p+="&amp;sr="+screen.width+"x"+screen.height;p+="&amp;cd="+screen.colorDepth; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">p+="&amp;jo="+(navigator.javaEnabled()?"Yes":"No"); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">} <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">d.write('&lt;img id="ONESTAT_TAG" border="0" width="1" height="1" src="'+p+'" &gt;'); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">} <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">OneStat_Pageview(); <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">//--&gt; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;/script&gt; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;NOscript&gt; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;A HREF="http://www.onestat.com"&gt;&lt;img border="0" width="1" height="1" <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">SRC="http://stat.onestat.com/stat.aspx?tagver=2&amp;sid=&lt;%=strAccountID%&gt;&amp;js=No&amp;"&gt; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;/A&gt; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;/NOscript&gt; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;!--ONESTAT scriptCODE END--&gt; <o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">&lt;% <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">end sub <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

<SPAN style="FONT-SIZE: 10pt; COLOR: black">%&gt; <SPAN style="FONT-SIZE: 10pt; COLOR: black"><o:p></o:p>

</FONT>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012