phpCOIN

Forum Rules Miscellaneous Add-Ons

For questions and issues dealing with miscellaneous add-ons that do not warrant their own forum, including questions about non-existant addons.

  Reply to this topicStart new topicStart Poll

> Google Analytics, How to set it up in phpCoin
Banzai
Posted: January 22, 2008 12:07 pm
Quote Post


Advanced Member
***

Group: Members
Posts: 128
Member No.: 3,055
Joined: July 31, 2007



Hey guys!

Hope you're all doing well.
I've been busy with some webdesign freelance jobs.
I recently had a guy over my website that must have liked it a lot, so instead asking me what software I was using, he created a lot of fake customers and fake orders to see how it works... blink.gif blink.gif blink.gif But I only found out that later. Now, I've seen that he installed coin on his domain.
Just wanted to share this goof's experience with you.

Back to what matters, I wanted to configure my website with the script from google analytics, but I don't how to. (still running 1.2.7)

Could you tell me what I need to do? and where exactly I have to insert the script so it works correctly?

Thanks! wink.gif
PMEmail PosterUsers Website
Top
cantex
Posted: January 23, 2008 12:17 am
Quote Post


Chief Cook & Bottle Washer
***

Group: Archive
Posts: 3,252
Member No.: 1
Joined: August 25, 2006



QUOTE
Just wanted to share this goof's experience with you.

We have a demo site so people can test phpCOIN, yet some folks still post test orders on the live site sad.gif

QUOTE
still running 1.2.7

You should upgrade to v1.3.1 ~ some minor new features and some bug fixes smile.gif

QUOTE
Could you tell me what I need to do? and where exactly I have to insert the script so it works correctly?

From Google Analytics site
QUOTE
Basic installation - Copy and paste the code segment into the bottom of your content, immediately before the </body> tag of each page you are planning to track. If you use a common include or template, you can enter it there.

So, in the theme's core.php file within function do_page_closeout() and immediately before the </body> tag is output, add some code to output the google code. for instance, in /cantex theme starting around line 995 is
CODE
# Add WYSIWYG (if found) to output
 IF ($tinymce) {$_out .= '';} ELSEIF ($htmlarea) {$_out .= $htmlarea;}

# Close html
 $_out .= '</body>'.$_nl;
 $_out .= '</html>'.$_nl;

Immediately before the # Close html line, add something like this
CODE

     $_out .= '<script type="text/javascript">
     var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
     document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
     </script>

     <script type="text/javascript">
     var pageTracker = _gat._getTracker("UA-xxxxxx-x");
     pageTracker._initData();
     pageTracker._trackPageview();
     </script>';

Note that since the string starts and ends with a single apostrophe, any apostrophes within the string must be preceded by a backslash to escape them.


--------------------
================================================================
Please do not email or PM me with a question:
1: I handle over a thousand emails a day, so chances are yours would be buried in the pile.
2: All questions will only be answered in the support forums, so the answers will be useful to others.

Help will be given to install/configure/use phpCOIN, but not programming help to modify phpCOIN operations. If you are competent enough to make programming changes, you should be competent enough to read the source code and figure things out :)

If you are trying to integrate posted sample code into your website, please take into account any changes in phpCOIN made after the code sample was posted. It is discouraging to spend hours answering questions or trying to track down an issue only to find that the user has a version of phpCOIN that makes the sample irrelevant
PM
Top
Banzai
Posted: January 23, 2008 09:44 am
Quote Post


Advanced Member
***

Group: Members
Posts: 128
Member No.: 3,055
Joined: July 31, 2007



Thanks for the answer. I think I can do this without problems. wink.gif

QUOTE
You should upgrade to v1.3.1 ~ some minor new features and some bug fixes

I know, but I've been busy trying to get some business going to even some investments I made.
I 'll have to get into that some time soon and try to figure out how it's going to work with the customizations I made, before upgrade.

QUOTE
So, in the theme's core.php file within function do_page_closeout() and...

I got the info from google analytics, but without this I could never do this! wink.gif
PMEmail PosterUsers Website
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 


Inscrita el Registro Mercantil de Mallorca Tomo 2140, Hoja No. PM-51034, Folio 135
This website owned and operated by: Technology Services RPVW S.L. CIF# B57345084
Avda Constitucion 48 Bajos Alaro 07340 Baleares SPAIN
Tel:+34 971518362    Fax: +34 971518368    eMail: support@phpcoin.com