PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
kevinkap
Involved
Involved


Joined: Apr 22, 2006
Posts: 352

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

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?
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2404
Location: Pennsylvania

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

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.
View user's profile Send private message Visit poster's website
kevinkap
Involved
Involved


Joined: Apr 22, 2006
Posts: 352

PostPosted: Sat Jan 23, 2010 8:42 pm Reply with quote Back to top

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
View user's profile Send private message
spasticdonkey
RavenNuke(tm) Development Team


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

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

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 to the forums!
View user's profile Send private message
montego
Former Admin in Good Standing


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

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

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.
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum