
Good morning all...
I'm just getting into ASP, so please bear with me.
I successfully loaded and installed Metatraffic2 into cgi-bin/metatraffic2 (my root has no write permissions).
I want to display my version of sdk_example.asp (statistics.asp)
on a webage located in cgi-bin/RC2.
So, in my cgi-bin/RC2/footer.asp file, before the copyright, I put:
I am getting an error as it seems it can't map to the file in
another sub-direcory. Can somone suggest a solution for me?
Perhaps if I made metatraffic2 a subdirectory of RC2, this
should work:
Not sure? Thanks folks for helping a newbie...Respectfully,
Marshall...
Works but won't display on page....
Try using a virtual include like this:
Works but won't display on page....
Thank you very much cdegroot...
I tried your recommendation and I replaced my line of code with:
When I tried to load the default.asp, I received the following error condition, I assume when it tried to load the footer:
Microsoft VBScript compilation error '800a0400'
Expected statement
/cgi-bin/metatraffic2/statistics.asp, line 1
Option Explicit
^
Any other suggestions?
Thanks a lot!! Respetfully, Marshall...
Works but won't display on page....
I tried adding a forward slash before cgi-bin, but that was flagged as a error.
Then I tried separating the HTML from statistics.asp leaving only the following in statistics.asp:
<% Option Explicit %>
<%
' DIM VARIABLES
Dim objStats, datStatsStart, datStatsEnd, strStartDate
Dim intPageViewsToday, intPageViewsTotal, intPageViewsPage
Dim intVisitsTotal, intVisitsToday, intVisitorsTotal, intVisitorsToday
Dim intUsersOnline, intDistinctPages
' CREATE METATRAFFIC STATS OBJECT AND SET SOME PARAMETERS
Set objStats = New MTReport
With objStats
.Database = aryMTDB
.Config = aryMTConfig
End With
Call CreateDatabaseConnection(0)
' GET FIRST HIT IN THE DB
datStatsStart = objStats.GetStartDate()
If Not IsDate(datStatsStart) Then
datStatsStart = Date()
strStartDate = "Database is empty."
Else
datStatsStart = DateSerial(Year(datStatsStart), Month(datStatsStart), Day(datStatsStart))
strStartDate = datStatsStart
End If
datStatsEnd = Date()
' GET PAGE VIEW STATS
intPageViewsToday = objStats.CountPageViews("", datStatsEnd, datStatsEnd)
intPageViewsTotal = objStats.CountPageViews("", datStatsStart, datStatsEnd)
intPageViewsPage = objStats.CountPageViews(Request.ServerVariables("script_name"), datStatsStart, Date())
' GET VISITS
intVisitsTotal = objStats.CountVisits(datStatsStart, datStatsEnd)
intVisitsToday = objStats.CountVisits(datStatsEnd, datStatsEnd)
' GET VISITORS
intVisitorsTotal = objStats.CountVisitors(datStatsStart, datStatsEnd)
intVisitorsToday = objStats.CountVisitors(datStatsEnd, datStatsEnd)
' GET SOME OTHER NUMBERS
intUsersOnline = objStats.CountUsersOnline()
intDistinctPages = objStats.CountDistinctPages()
' CLEANUP
Call CloseDatabaseConnection()
Set objStats = Nothing
%>
Then in my applications ASP file, I added the following:
Website Statistics - Log Started: <% = strStartDate %>
Users Online
Visits Today
Total Visits
<% = intUsersOnline %>
<% = intVisitsToday %>
<% = intVisitsTotal %>
The "literals" in the table above appear but not the data. I get the following error which indicates it doesnn't like the <% Option Explicit %> in my statistics.asp file.
Microsoft VBScript compilation error '800a0400'
Expected statement
/cgi-bin/metatraffic2/statistics.asp, line 1
Option Explicit
^ the ASP fils
Thanks your for your help! Respectfully, Marshall...
Works but won't display on page....
OK - made some progress:
Previously:
1. Installed Metatraffic2 in my cgi-bin folder.
a. Took sdk_example.asp and made a statistics.asp file from it,
modifying the HTML in the table of statistics ASP to display
only the counts I want. (didn't remove any other code as I
may want to use the counts not displayed at a later time)
Today:
2. Installed a Classified Ads program in my cgi-bin folder.
a. I modified the Classified Ads program's footer.asp file,
before the copyright line, to add the following:
<% Server.Execute("/cgi-bin/metatraffic2/statistics.asp") %>
b. Partial succcess: Next to "Visitors Since:", the correct
date appeared and also the correct number of visitors
<% = intVisitsTotal %> appeared, all other counts are "zero".
4. Next, I logged into the Classified ads program and do not see the counts updated for "Users Online" <% = intUsersOnline %>, "Visitors Today" <% = intVisitsToday %>, and "New Visitors Today" <% = intVisitorsToday %>
Any ideas why I am not getting those counts?
Rspectfully, Marshall...
Works but won't display on page....
[:p] Success, figured out why I didn't get the other counts described in my earlier post.
I needed to add the following line in my footer.asp:
<% Server.Execute("/cgi-bin/metatraffic2/track.asp") %>
which actually updates the counts.
Then, add the following line in my footer.asp:
<% Server.Execute("/cgi-bin/metatraffic2/statistics.asp") %>
which displays the counts on the page.
Somehow, reading the instructions, I either missed that or
initilly I just didn't understand what I was reading.
Q: Since I now have those lines of code in my footer.asp file, will metatraffic2 record the different ASP pages visited?
Thanks for being patient with me folks and for helping me.
Respectfully, Marshall...
Works but won't display on page....
Addendum: In my last post I simply added a link to track.asp.
When I checking my statistics, I noticed a tab at the top of the page labeled "Tracking".
There I found a reference to tracking "web pages" and the code to enter in my footer.asp, replaceing the link to track.asp in my last post.
I am very happy to have this working :), metatraffic is a teriffic sofware package!
Respectfully, Marshall...
Works but won't display on page....
Now that I have the statistics showing in my ASP page,
I would like to display the similar stats embedded in my
home page, a .HTM file.
I've searched the forum and re-read the documentation and
do not see the code.
Would someone please post the code for me or advise where to look.
Thanks in advance.
Respectfully, Marshall...