How to add Web CEO tracking code

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
User avatar
painterman
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Nov 17, 2010 10:33 am
Location: Cheshire UK
Contact:

How to add Web CEO tracking code

Post by painterman » Wed Mar 30, 2011 11:27 am

Hi everyone, does anyone know how to add the tracking code generated by the Web CEO software.
I have used this software for years on static sites but can find no info on adding their code to Joomla sites.
I can't be the only one can I? :(
help please and thanks for any response.
Life's too short so live it.
Take care.

User avatar
Siege21
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 132
Joined: Fri Feb 12, 2010 5:13 pm
Location: Ludlow, UK
Contact:

Re: How to add Web CEO tracking code

Post by Siege21 » Wed Mar 30, 2011 1:44 pm

Hi.

I've never used WEb CEO, but I assume the tracking code needs to sit between certain HTML tags?

If you can add it static websites, the same approach can be used in Joomla. Located your templates index.php file, and insert the code there.

You can do this by browsing to the template manager, selecting your template and clicking on Edit HTML (top right), or by navigating to templates/yourtemplate/ via FTP and download index.php and edit it in notepad or whatever software you use for editing HTML.

All of the usual HTML tags should be present in the index file (<head> <body> etc), so it should eb just like adding it to a static website.

However, if you are using a template which uses a framework (such as Gantry, Warp or T3), then things get a little more complicated. If this is the case, let us know where the code needs to be, and what template you are using and we'll be able to help you.

Hope this helps! :)
"Buy land! They've stopped making it" - Mark Twain

http://www.antonydoyle.co.uk

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 20652
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S'pore/Bogor/ North America
Contact:

Re: How to add Web CEO tracking code

Post by leolam » Wed Mar 30, 2011 2:01 pm

painterman wrote:Hi everyone, does anyone know how to add the tracking code generated by the Web CEO software.
As with Google Analytics you will have to add it to either the <head> section of your template's index.php or just before the closing tag </body> of the same file

Leo 8)
Joomla's #1 Professional Services Provider:
#Joomla Professional Support: https://gws-desk.com -
#Joomla Specialized Hosting Solutions: https://gws-host.com -

User avatar
painterman
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Nov 17, 2010 10:33 am
Location: Cheshire UK
Contact:

Re: How to add Web CEO tracking code

Post by painterman » Wed Mar 30, 2011 4:28 pm

Hi, I'm not sure how I'm going to do this...
The Web CEO software needs to scan every page in the site, that alone puts the skids under me I think..
I used to use statcounter.com, I saw a plugin last night for Joomla sites that make it look so easy.
If I didn't have to insert code into every page this Web CEO wouldn't be a problem.
I have tried inserting the code into the article code view and it won't stick, as soon as I update the page it falls away to just leave the commenting, which I think is right.

I cannot just add this code, without the name id, to a <head> or before the <body> tag as I use the purity_ii template which is a T3 framework template.
I think I'm kippered on this...
I have sent an e-mail requesting help from Web CEO, that was two days ago and I'm still waiting, it's a shame it's a heck of a good program.

Thanks to you both, John.

This is an example of the code I need to use, the following .html page is a test page: ./peterweston/index.html

<!--WEBSITECEO:BEGIN:{764EEF2E-BC11-45CF-8627-300CE1BA2219}-->
<!--
Do NOT modify this script to avoid traffic misrepresentation!
Web CEO 4 0300/1
Code initially inserted into: "./peterweston/index.html".
-->
<script type="text/javascript"><!--
// hitlens v1.2.7
function hitlens_embedded() {
var id = 434923;
var pc = 2;
var PAGENAME = escape('');
var CONTENTGROUP = escape('');
var TRANSACTION = escape('');
var TRANSACTION_ID = 0;
var ORDER = escape('');
return "id="+id+"&pc="+pc+"&p="+PAGENAME+"&gr="+CONTENTGROUP+"&tr="+TRANSACTION+"&trid="+TRANSACTION_ID+"&ord="+ORDER;
}
//--></script>
<script type="text/javascript" src="/webceo.js"></script>
<!--WEBSITECEO:END:{764EEF2E-BC11-45CF-8627-300CE1BA2219}-->
Life's too short so live it.
Take care.

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 20652
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S'pore/Bogor/ North America
Contact:

Re: How to add Web CEO tracking code

Post by leolam » Wed Mar 30, 2011 4:40 pm

You can add this code to the 'head' section of your template's index.php and you should be ok

Leo 8)
Joomla's #1 Professional Services Provider:
#Joomla Professional Support: https://gws-desk.com -
#Joomla Specialized Hosting Solutions: https://gws-host.com -

User avatar
Siege21
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 132
Joined: Fri Feb 12, 2010 5:13 pm
Location: Ludlow, UK
Contact:

Re: How to add Web CEO tracking code

Post by Siege21 » Wed Mar 30, 2011 4:46 pm

The index.php template file is loaded on every page. Simply adding it in there will ensure it is on every page. There's no need to put it your articles.

Look at your URL's as you browse the website. You'll see that they all start yoursite.com/index.php and then a string of queries depending on what is being loaded.

I don't have any templaets using the T3 framework to hand, but in the index.php file you should have at least the <head> tags. If you don't, let me know and I'll go digging and see if I can find one of those templates and look to see where it should go for you.
"Buy land! They've stopped making it" - Mark Twain

http://www.antonydoyle.co.uk

User avatar
painterman
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Nov 17, 2010 10:33 am
Location: Cheshire UK
Contact:

Re: How to add Web CEO tracking code

Post by painterman » Wed Mar 30, 2011 4:59 pm

Okay, thanks to you both.

I have added the code to the head.php of the template file and it now shows in all pages, that is thr main problem I'm going to have as each page has its own id...
I need Web CEO to come up with a fix now I reckon it's over to them.
I shall check my stats in the next hour or so to see if the script does work, if it does then it's a partial result.
Many thanks and I will post again within the next couple of hours to let you know how I go on.
Take care all, John.
Life's too short so live it.
Take care.

WebCEO
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Mar 31, 2011 7:29 am

Re: How to add Web CEO tracking code

Post by WebCEO » Thu Mar 31, 2011 7:53 am

Painterman,
Here's the HitLens setup instructions from WebCEO Support for a site created with Joomla 1.5.2.


1. Find the {joomla} folder - let it be the directory where the cms is stored (the path to the root directory of your website).

2. Find the head.php file located in {joomla}/libraries/joomla/document/html/renderer folder.

3. Open the head.php in some text editor and find the following code:

----------------------------------------------------------------------------------------------
$strHtml .= $tab.'<meta name="description" content="'.$document->getDescription().'" />'.$lnEnd;
$strHtml .= $tab.'<meta name="generator" content="'.$document->getGenerator().'" />'.$lnEnd;

$strHtml .= $tab.'<title>'.htmlspecialchars($document->getTitle()).'</title>'.$lnEnd;

----------------------------------------------------------------------------------------------
Insert the following code right after these lines:
----------------------------------------------------------------------------------------------
$strHtml .= $tab.'<script language="JavaScript" type="text/javascript">var wceoTitle="'.htmlspecialchars($document->getTitle()).'"</script>'.$lnEnd;

----------------------------------------------------------------------------------------------
4. Save the changes.
5. Insert the tracking code to each of the template files.
- go to {joomla}/templates/{template name}/
*{template name} - you should see the name of your current template folder instead of this
- open index.php
- insert HitLens tracking code right before the closing body tag

Like this:


<script language="javascript"><!--
// hitlens v1.2.5
function hitlens_embedded() {
var id = {site id};
var pc = 0;
var PAGENAME = escape(wceoTitle);
var CONTENTGROUP = escape('');
var TRANSACTION = escape('');
var TRANSACTION_ID = 0;
var ORDER = escape('');
return "id="+id+"&pc="+pc+"&p="+PAGENAME+"&gr="+CONTENTGROUP+"&tr="+TRANSACTION+"&trid="+TRANSACTION_ID+"&ord="+ORDER;
}
//--></script>
<script language="javascript" src="/webceo.js"></script>


</body>
</html>

6. Specify your website id in the var id = {site id}; line. You can find your website ID in Web CEO Project Manager.
7. Upload the external webceo.js script (it can be found here http://www.webceo.com/webceo.js) to the root directory - {joomla}/ .

If you could please specify the email from which you wrote to WebCEO Support, we would check if your message was received and replied to (we usually reply to ALL support requests).

Regards,
Lana Zaitseff
WebCEO
[email protected]

User avatar
painterman
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Nov 17, 2010 10:33 am
Location: Cheshire UK
Contact:

Re: How to add Web CEO tracking code

Post by painterman » Thu Mar 31, 2011 10:55 am

WebCEO wrote:Painterman,
Here's the HitLens setup instructions from WebCEO Support for a site created with Joomla 1.5.2.


1. Find the {joomla} folder - let it be the directory where the cms is stored (the path to the root directory of your website).

2. Find the head.php file located in {joomla}/libraries/joomla/document/html/renderer folder.

3. Open the head.php in some text editor and find the following code:

----------------------------------------------------------------------------------------------
$strHtml .= $tab.'<meta name="description" content="'.$document->getDescription().'" />'.$lnEnd;
$strHtml .= $tab.'<meta name="generator" content="'.$document->getGenerator().'" />'.$lnEnd;

$strHtml .= $tab.'<title>'.htmlspecialchars($document->getTitle()).'</title>'.$lnEnd;

----------------------------------------------------------------------------------------------
Insert the following code right after these lines:
----------------------------------------------------------------------------------------------
$strHtml .= $tab.'<script language="JavaScript" type="text/javascript">var wceoTitle="'.htmlspecialchars($document->getTitle()).'"</script>'.$lnEnd;

----------------------------------------------------------------------------------------------
4. Save the changes.
5. Insert the tracking code to each of the template files.
- go to {joomla}/templates/{template name}/
*{template name} - you should see the name of your current template folder instead of this
- open index.php
- insert HitLens tracking code right before the closing body tag

Like this:


<script language="javascript"><!--
// hitlens v1.2.5
function hitlens_embedded() {
var id = {site id};
var pc = 0;
var PAGENAME = escape(wceoTitle);
var CONTENTGROUP = escape('');
var TRANSACTION = escape('');
var TRANSACTION_ID = 0;
var ORDER = escape('');
return "id="+id+"&pc="+pc+"&p="+PAGENAME+"&gr="+CONTENTGROUP+"&tr="+TRANSACTION+"&trid="+TRANSACTION_ID+"&ord="+ORDER;
}
//--></script>
<script language="javascript" src="/webceo.js"></script>


</body>
</html>

6. Specify your website id in the var id = {site id}; line. You can find your website ID in Web CEO Project Manager.
7. Upload the external webceo.js script (it can be found here http://www.webceo.com/webceo.js) to the root directory - {joomla}/ .

If you could please specify the email from which you wrote to WebCEO Support, we would check if your message was received and replied to (we usually reply to ALL support requests).

Regards,
Lana Zaitseff
WebCEO
[email protected]
Hi Lana,
I have made the changes to the head.php file as instructed above by yourself, no problems.
However, I cannot find thefollowing:
- go to {joomla}/templates/{template name}/
*{template name} - you should see the name of your current template folder instead of this
- open index.php
- insert HitLens tracking code right before the closing body tag
The index.php file shows no mention of the closing body tag.

The file is index.php, the full path is: joomla/templates/ja_purity_ii/index.php
The only code in that file is commented below, there is no mention of html tags at all.
//Calculate the width of template
//Main navigation
//End for main navigation

I think my index.php file is not the same as you refer to, I use the T3 framework for the purity_ii template.
Can you please be kind enough to take another quick look for me, thanks.
- go to {joomla}/templates/{template name}/
*{template name} - you should see the name of your current template folder instead of this
- open index.php
- insert HitLens tracking code right before the closing body tag
Lana, I think I may have found the file I need it is:
joomla/templates/ja_purity_ii/layouts/default.php

I have added the second lot of code you gave above just before the body end tag.

NO this doesn't work....
John.
Life's too short so live it.
Take care.

WebCEO
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Mar 31, 2011 7:29 am

Re: How to add Web CEO tracking code

Post by WebCEO » Thu Mar 31, 2011 12:37 pm

Painterman,
For your template the code should be inserted to the footer.php file located in
{joomla}/templates/{{ja_purity_ii}}/layouts/blocks/footer.php

User avatar
painterman
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Nov 17, 2010 10:33 am
Location: Cheshire UK
Contact:

Re: How to add Web CEO tracking code

Post by painterman » Thu Mar 31, 2011 12:59 pm

WebCEO wrote:Painterman,
For your template the code should be inserted to the footer.php file located in
{joomla}/templates/{{ja_purity_ii}}/layouts/blocks/footer.php
Thanks Lana,
I have done that and the code is now showing in the site.
One thing though, the code has wrapped itself into a div tag!
I presume this is okay!
What do you think....

Millions of thanks as well, not just for me but all Joomla users who want to use the Web CEO Hitlens.. :)
Life's too short so live it.
Take care.

WebCEO
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Mar 31, 2011 7:29 am

Re: How to add Web CEO tracking code

Post by WebCEO » Thu Mar 31, 2011 1:50 pm

There should not be issues with the div tag, the js code will be run.

Welcome! And thankks for using our service.

mark1billion
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Feb 07, 2012 1:04 am

Re: How to add Web CEO tracking code

Post by mark1billion » Fri Mar 30, 2012 12:09 am

WEBCEO for Jooma 2.5

To add tracking code to 2.5 change this code;

CHANGE: $strHtml . to $buffer .

Example:


$strHtml .= $tab.'<script type="text/javascript">var wceoTitle="'.htmlspecialchars($document->getTitle()).'"</script>'.$lnEnd;


to this;


$buffer .= $tab.'<script type="text/javascript">var wceoTitle="'.htmlspecialchars($document->getTitle()).'"</script>'.$lnEnd;

mark1billion
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Feb 07, 2012 1:04 am

Re: How to add Web CEO tracking code

Post by mark1billion » Tue May 01, 2012 2:30 am

WEBCEO is pissing me off...I don't use it for weeks, when I want to use it, buggy as hell - not connecting, keyword reports are all wrong.......and I paid for this.. :-\


Locked

Return to “General Questions/New to Joomla! 1.5”