Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - Feedback
Author Message
kevinkap
Involved
Involved


Joined: Apr 22, 2006
Posts: 356

PostPosted: Sat Jan 23, 2010 3:09 pm Reply with quote

I had put together a site for a friend, he wants to be able to track page visits by adding some code after the body tag on each page. The tracking code actually runs through a marketing site that can send him real time stats to his iphone and such, since the site is dynamic can I do this?

_________________
Kevin Kappes 
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sat Jan 23, 2010 5:50 pm Reply with quote

Yes it is possible, but in order for anyone to offer a suggestion how we need to know more about how this is supposed to work.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
kevinkap
PostPosted: Sat Jan 23, 2010 8:42 pm Reply with quote

basically i just have to add a cple lines of code to the desired pages for tracking.

Code:
<script src='http://moonraymarketing.com/tracking.js' type='text/javascript'></script>

<script>
_mri = "2092_1_2";
mrtracking();
</script>


but since the pages are dynamic, i am not sure where to put the code
 
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Sat Jan 23, 2010 9:49 pm Reply with quote

you could probably just go to
admin -> preferences

and add it to one of the footer sections

to make it compliant I changed it a little, but try adding that to your footer,
just make sure to use the WYSIWYG editor in "source" mode Smile

Code:
<script src='http://moonraymarketing.com/tracking.js' type='text/javascript'></script>

<script type='text/javascript'>
/*<![CDATA[*/
_mri = "2092_1_2";
mrtracking();
/*]]>*/
</script>


if you curious why I added that... Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message Visit poster's website
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9456
Location: Arizona

PostPosted: Sun Jan 24, 2010 10:19 am Reply with quote

Or, do what I do, and add to a script called: includes/custom_files/custom_footer.php. If you do not already have this script, you simply need to create a new one with this name and start it off with:

<?php

So, for your example, this might work just fine:

Code:


<?php
echo <<<_JS_
<style type="text/css">
<!--
<script src='http://moonraymarketing.com/tracking.js' type='text/javascript'></script>
<script type='text/javascript'>
/*<![CDATA[*/
_mri = "2092_1_2";
mrtracking();
/*]]>*/
</script>
-->
</style>
_JS_;


I purposely did not close the file with a "?>" although it is fine to put it there as long as there is nothing after it, not even a newline/space.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.20.00 - Feedback

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©