Page 1 of 1

Analytics Code

PostPosted: Tue Mar 10, 2009 2:29 pm
by larryweiss
Is there any way to include google analytics code?

PostPosted: Wed Mar 11, 2009 8:47 am
by shannah
Yes. There are many ways. One way is to just paste the code into the "Custom Footer" field in Auction Settings.

I am not understang

PostPosted: Wed Mar 11, 2009 10:29 am
by larryweiss
I have pasted the code into global_footer.html
and also tried to paste into Dataface_Main_Template.html

Both gave me an error:
Fatal error: Smarty error: [in Dataface_Main_Template.html line 83]: syntax error: unrecognized tag 'var' (Smarty_Compiler.class.php, line 590)

I have searched the files for the words "custom" and "footer"

Also searched the site for: custom footer and custom-footer and custom_footer.

The last turned up something but it looked like I was not to go there.

Thank you for your speedy answer, but can you be a little more descriptive.

PostPosted: Wed Mar 11, 2009 10:42 am
by shannah
The errors that you received are due to the fact that javascript uses curly braces as part of its syntax - which trips up smarty.

You can tell smarty to ignore a section by wrapping it in {literal}{/literal} tags. i.e:

Code: Select all
{literal}
... your analytics code here ...
{/literal}


This only applies when placing code in a smarty template. This is not necessary from any other context.

Your idea of putting it in global_footer.html is a fine one.

The alternative I mentioned is done though the web. Log in as admin, click on "Auction Settings" on the left menu. There is a field called "custom footer" (it may be in a section that is default collapsed, but it is there).

-Steve

PostPosted: Wed Mar 11, 2009 12:25 pm
by larryweiss
That was easy. Thank you.

I have changed %%E2^E20^E208543E%%public_product_list.html.php line 13 to:

getURL('-action=view'); ?>"; onClick="pageTracker._trackEvent('{$product-}', 'Auction');">"

and public_product_list.html line 5 to:

href="{$product->getURL('-action=view')}" onClick="pageTracker._trackEvent('{$product-}', 'Auction');">

Those changes have not interfered with the display of the auction, so I am assuming no harm done. Is that correct and will it work?

By the way:
The beginning of each line of code is truncated. Probably phpbb is having a problem with the whole of the line. It will not display much beyond <li>.


Thank you again.

PostPosted: Thu Mar 12, 2009 10:43 am
by shannah
This should be fine. No need to modify the %%E2^E20^E208543E%%public_product_list.html.php file (in the templates_c) directory as this is just automatically generated from the contents of public_product_list.html.

If you want to post HTML code and don't want PHPBB to mess with it you can check the "Disable HTML in this Post" checkbox.

-Steve