| Author |
Message |
kevinkap Involved


Joined: Apr 22, 2006 Posts: 352
|
Posted:
Sat Jan 23, 2010 3:09 pm |
|
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? |
|
|
|
 |
Palbin Site Admin

Joined: Mar 30, 2006 Posts: 2404 Location: Pennsylvania
|
Posted:
Sat Jan 23, 2010 5:50 pm |
|
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. |
|
|
|
 |
kevinkap Involved


Joined: Apr 22, 2006 Posts: 352
|
Posted:
Sat Jan 23, 2010 8:42 pm |
|
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: 1253 Location: Texas, USA
|
Posted:
Sat Jan 23, 2010 9:49 pm |
|
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
| 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...
|
|
|
|
 |
montego Former Admin in Good Standing

Joined: Aug 29, 2004 Posts: 9071 Location: Arizona
|
Posted:
Sun Jan 24, 2010 10:19 am |
|
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. |
|
|
|
 |
|
|
|
|