Search This Blog

Jan 20, 2011

How to install tracking code in magento

After finishing my first mmagento site for my beloved client:). He sent over a bundle of tracking code in order track their site sales, users stats etc. Though it is just a copy paste thing you need to be careful in pasting those tracking scripts to avoid errors to your site. Google analytics, quancast, revenue expect and more are some of the tracking scripts they want me to plug in. Now, I'm going to show you on how to insert tracking code in Magento in an easiest way.

How to Insert Tracking code in Magento

Almost of tracking code mention above are collector code, meaning they collect information such as number of visits, pageviews and more.

Inserting scripts between the header tag html section

You can simply add those tracking scripts in magento backend.
1. Login to your magento site.
2. Go to System Tab > Configuration. Under the General Tab > Select Design.
3. In Design configuration, Click HTML Head.
4. Copy your tracking code from google analytics, quancast or any other tracking website and paste it under Miscellaneous scripts text area.


scripts before the body closing tag

1. Login to your magento site.
2. Go to System Tab > Configuration. Under the General Tab > Select Design.
3. In Design configuration, Click Footer.
4. Copy your tracking code from google analytics, quancast or any other tracking website and paste it under Miscellaneous HTML text area.


scripts that need to insert in the thank you page.
scripts such as adwords, revenue expect and other sales tracking code are usually insert tracking code in the success page. In order to do this, you need to manually paste the code under the phtml file of your theme.

1. Login to you FTP using your FTP access account.
2. Navigate to your theme directory.
/app/design/frontend/default/[templatename]/template/checkout/success.phtml
3. Download the file and open it in to your favorite editor.
4. Paste your thank you code at the end and save it.
5. Upload in the same directory and holla your done!.

Feel free to comments or share your ideas.

8 comments:

Magento Design UK said...

Great post thanks for sharing such informative post.

durga said...

Very nice. This is beautiful work.
Web Development UK

terrylittrell said...

Thanks for the post about magento ecommerce. keep it up more post.Magento Developers

Ubermums Maternity said...

Thanks alot , that was just what i was looking for. May i know if there is any difference in inserting the scripts in the Header tag as compared to the Body Closing Tag? Or should i do both?
Thanks alot. Edwina

Ubermums Maternity said...

HI, thanks for sharing.It was the info that i was looking for. One question if its not too much trouble: May i know if there is any difference in inserting the scripts between the Header Tag as compared to the Body Closing Tag? Or should i do both?
Thanks.Edwina

Party Supplies said...

Rather than going to FTP and search for the file, this is the easiest solution to add code in header or footer! Thanks

nilesh said...

Thanks for the tracking code. It helped me in my work.

Magento webshop said...

Thanks for sharing. I really appreciate and keep more posting about Magento Webshop.