/    Sign up×
Community /Pin to ProfileBookmark

xhtml and tracking code

I have taken pride in building a site using xhtml1.0 and css and having them validate strict.
Due to the ineptness of the tracking system used by my host I have been forced to subscribe to a 3rd party tracking system. (iwebtrack).
The code that needs to be placed on each page appears to be impossible to validate strict xhtml or even transitional.
The validation of a page has become a great tool in finding errors. Most commonly the simple ones that could take hours to find without it. But now each page shows numerous errors due to this invalid code and renders the validator useless.
Has anyone found a way to validate the tracking code generated by this service or is there another company that offers valid code?
The site in question is [url]http://www.northcrafts.com/[/url]
Sincerely,
Tom Beach

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@Paul_JrApr 10.2004 — This validates
[size=1]
<!-- BEGIN iWebTrack G2 CODE -->
<!-- Copyright (c) 2004 iWebTrack.com -->
&lt;!-- Privacy Information is available at <a href="http://www.iwebtrack.com">http://www.iwebtrack.com</a> --&gt;
&lt;script type="text/javascript"&gt;
// Modification of this code is prohibited and will result in account de-activation
var test = "false"
var p ="http"+(document.URL.indexOf('https:')==0?'s':'')+"://";
if (p == "https://")
var src ="https://secure.iwebtrack.com/s/";
else
var src ="http://stats.iwebtrack.com/";
if (test == "false") var tm ="style='border: 0;' width='0' height='0'";
document.write("&lt;"+"img "+tm+" src='"+src+"ntrack.asp?id=12628&amp;amp;referer="+document.referrer.replace(/&amp;amp;/g,'!~!')+"&amp;amp;title="+document.title+"&amp;amp;url="+document.URL+"'&gt;")
&lt;/script&gt;
&lt;noscript&gt;
&lt;div&gt;&lt;img style="border: 0;" width="0" height="0" alt="tracker" src="http://stats.iwebtrack.com/ntrack.asp?id=12628&amp;amp;java=no" /&gt;&lt;/div&gt;
&lt;/noscript&gt;
&lt;!-- END iWebTrack CODE --&gt;

[/size]


[b]***EDIT***[/b]

Heheh, well, I just noticed that thing at the top that says modifying the code will result in account de-activation... :mad:

So, maybe you don't wanna do that, but I don't know any other way of getting it to validate.
Copy linkTweet thisAlerts:
@tbeach44authorApr 10.2004 — Thanks for taking the time but It comes back with a ton of errors.

Line 182, column 20: character "<" is the first character of a delimiter but occurred as data

document.write("<"+"img "+tm+" src='"+src+"ntrack.asp?id=12628&referer="+doc

^

Line 182, column 67: cannot generate system identifier for general entity "referer"

...tm+" src='"+src+"ntrack.asp?id=12628&referer="+document.referrer.replace(/&/g

^

Line 182, column 67: general entity "referer" not defined and no default entity (explain...).

...tm+" src='"+src+"ntrack.asp?id=12628&referer="+document.referrer.replace(/&/g

^

Line 182, column 74: reference not terminated by REFC delimiter

...c='"+src+"ntrack.asp?id=12628&referer="+document.referrer.replace(/&/g,'!~!')

^

Line 182, column 74: reference to entity "referer" for which no system identifier could be generated

...c='"+src+"ntrack.asp?id=12628&referer="+document.referrer.replace(/&/g,'!~!')

^

Line 182, column 66: entity was defined here

...+tm+" src='"+src+"ntrack.asp?id=12628&referer="+document.referrer.replace(/&/

^

Line 182, column 104: character "&" is the first character of a delimiter but occurred as data

...referer="+document.referrer.replace(/&/g,'!~!')+"&title="+document.title+"&ur

^

Line 182, column 117: cannot generate system identifier for general entity "title"

...ument.referrer.replace(/&/g,'!~!')+"&title="+document.title+"&url="+document.

^

Line 182, column 117: general entity "title" not defined and no default entity (explain...).

...ument.referrer.replace(/&/g,'!~!')+"&title="+document.title+"&url="+document.

^

Line 182, column 122: reference not terminated by REFC delimiter

....referrer.replace(/&/g,'!~!')+"&title="+document.title+"&url="+document.URL+"

^

Line 182, column 122: reference to entity "title" for which no system identifier could be generated

....referrer.replace(/&/g,'!~!')+"&title="+document.title+"&url="+document.URL+"

^

Line 182, column 116: entity was defined here

...cument.referrer.replace(/&/g,'!~!')+"&title="+document.title+"&url="+document

^

Line 182, column 142: cannot generate system identifier for general entity "url"

.../g,'!~!')+"&title="+document.title+"&url="+document.URL+"'>")

^

Line 182, column 142: general entity "url" not defined and no default entity (explain...).

.../g,'!~!')+"&title="+document.title+"&url="+document.URL+"'>")

^

Line 182, column 145: reference not terminated by REFC delimiter

...'!~!')+"&title="+document.title+"&url="+document.URL+"'>")

^

Line 182, column 145: reference to entity "url" for which no system identifier could be generated

...'!~!')+"&title="+document.title+"&url="+document.URL+"'>")

^

Line 182, column 141: entity was defined here

...&/g,'!~!')+"&title="+document.title+"&url="+document.URL+"'>")

^

Line 185, column 120: cannot generate system identifier for general entity "java"

...ts.iwebtrack.com/ntrack.asp?id=12628&java=no" /></div>

^

Line 185, column 120: general entity "java" not defined and no default entity (explain...).

...ts.iwebtrack.com/ntrack.asp?id=12628&java=no" /></div>

^

Line 185, column 124: reference not terminated by REFC delimiter

...webtrack.com/ntrack.asp?id=12628&java=no" /></div>

^

Line 185, column 124: reference to external entity in attribute value

...webtrack.com/ntrack.asp?id=12628&java=no" /></div>

^

Line 185, column 124: reference to entity "java" for which no system identifier could be generated

...webtrack.com/ntrack.asp?id=12628&java=no" /></div>

^

Line 185, column 119: entity was defined here

...ats.iwebtrack.com/ntrack.asp?id=12628&java=no" /></div>
Copy linkTweet thisAlerts:
@Paul_JrApr 10.2004 — Ah, my bad, you'll have to convert all the &'s to &amp;amp;, and then it should work.
Copy linkTweet thisAlerts:
@crh3675Apr 11.2004 — How about using CDATA tags

<i>
</i>&lt;!-- BEGIN iWebTrack G2 CODE --&gt;
&lt;!-- Copyright (c) 2004 iWebTrack.com --&gt;
&lt;!-- Privacy Information is available at <a href="http://www.iwebtrack.com">http://www.iwebtrack.com</a> --&gt;
&lt;script type="text/javascript"&gt;
//&lt;![CDATA[
// Modification of this code is prohibited and will result in account de-activation
var test = "false"
var p ="http"+(document.URL.indexOf('https:')==0?'s':'')+"://";
if (p == "https://")
var src ="https://secure.iwebtrack.com/s/";
else
var src ="http://stats.iwebtrack.com/";
if (test == "false") var tm ="style='border: 0;' width='0' height='0'";
document.write("&lt;"+"img "+tm+" src='"+src+"ntrack.asp?id=12628&amp;referer="+document.referrer.replace(/&amp;/g,'!~!')+"&amp;title="+document.title+"&amp;url="+document.URL+"'&gt;")
//]]&gt; <br/>
&lt;/script&gt;
&lt;noscript&gt;
&lt;div&gt;&lt;img style="border: 0;" width="0" height="0" alt="tracker" src="http://stats.iwebtrack.com/ntrack.asp?id=12628&amp;java=no" /&gt;&lt;/div&gt;
&lt;/noscript&gt;
&lt;!-- END iWebTrack CODE --&gt;
Copy linkTweet thisAlerts:
@tbeach44authorApr 11.2004 — At a glance I didn't think it was just the &amp;'s for & that was the problem, but went through the exercise and was pleasantly surprised with a validated page.

Of course the next question is, does the code work to generate the stats?

First indications are yes!

I'll monitor it for the next couple of days before i place it on all the pages. Once we're confident that the tracking is working we'll talk to the iwebtrack people to see if it's OK to alter the code as it is. My original conversation with them led me to believe that the altering they are worried about would concern ways of using it for free, or maliciously adding page views to an unsuspecting client.

Thanks Paul, I really didn't think this could be done, or they would have done it already.

Tom
×

Success!

Help @tbeach44 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...