Post by Anndreee » Sat May 02, 2009 6:03 am

Hey!

Im not good in php and i wanna put JS from google analytics to my page.
Daniel Kerr said that I have to make footer.tpl file in this directory: view/template/common directory

Can somebody help me with making this file, or make it. I would be gratefull!

Thanks!
Andre

Newbie

Posts

Joined
Sat May 02, 2009 5:59 am

Post by phpuk » Sat May 02, 2009 9:32 am

Hi,

Open the script catalog/view/theme/default/template/common/footer.tpl

It should look like this:

Code: Select all

<div class="div1"><img src="catalog/view/theme/default/image/payment.png" alt="" /></div>
<div class="div2"><?php echo $text_powered_by; ?></div>
Change it to look like this:

Code: Select all

<div class="div1"><img src="catalog/view/theme/default/image/payment.png" alt="" /></div>
<div class="div2"><?php echo $text_powered_by; ?></div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "your id";
urchinTracker();
</script>
Replace "your id" with the id supplied to you and make sure you put it within the quotes (" ").

Phil.

Global Moderator

Posts

Joined
Wed Mar 25, 2009 10:57 am

Post by Anndreee » Sat May 02, 2009 5:16 pm

The problem is that in this directory there is no footer.tpl file. There is only home.tpl, failure.tpl and success.tpl. Have I to do footer.tpl file there?, and put the script you gave me?

The only footer.tpl files are in those directory's:
htdocs\catalog\view\theme\default\template\module
htdocs\admin\view\template\module

Thanks!
Andre

Newbie

Posts

Joined
Sat May 02, 2009 5:59 am

Post by phpuk » Sat May 02, 2009 6:50 pm

Sorry that was for ver 1.2.6 but you can sill use the same code for 1.2.5.

The script you need to edit is: catalog/view/theme/default/template/module/footer.tpl.

Phil.

Global Moderator

Posts

Joined
Wed Mar 25, 2009 10:57 am

Post by Anndreee » Sat May 02, 2009 7:04 pm

<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">
try {
var pageTracker = _gat._getTracker("UA-8510733-1");
pageTracker._trackPageview();
} catch(err) {}</script>

Is the bold text the ID?

Newbie

Posts

Joined
Sat May 02, 2009 5:59 am

Post by Anndreee » Sat May 02, 2009 9:02 pm

I've tried diffrent ways to do this and it didnt worked.

Code: Select all

<div class="div1"><img src="catalog/view/theme/default/image/payment.png" alt="" /></div>
<div class="div2"><?php echo $text_powered_by; ?></div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-8510733-1";
urchinTracker();
</script>

Code: Select all

<div class="div1"><img src="catalog/view/theme/default/image/payment.png" alt="" /></div>
<div class="div2"><?php echo $text_powered_by; ?></div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-8510733-1");
pageTracker._trackPageview();
} catch(err) {}</script>

Code: Select all

<div class="div1"><img src="catalog/view/theme/default/image/payment.png" alt="" /></div>
<div class="div2"><?php echo $text_powered_by; ?></div>
<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">
try {
var pageTracker = _gat._getTracker("UA-8510733-1");
pageTracker._trackPageview();
} catch(err) {}</script>
What is wrong?

Thanks!
Andre

Newbie

Posts

Joined
Sat May 02, 2009 5:59 am

Post by Anndreee » Sun May 03, 2009 5:55 pm

Hello!

It is working.

Code: Select all

<div class="div1"><img src="catalog/view/theme/default/image/payment.png" alt="" /></div>
<div class="div2"><?php echo $text_powered_by; ?></div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-8510733-1";
urchinTracker();
</script>
I didn't know that it shows results the next day..

Thanks 4 all!
Andre

Newbie

Posts

Joined
Sat May 02, 2009 5:59 am
Who is online

Users browsing this forum: No registered users and 83 guests