Adding Metatags to ZenCart
Adding Google-analytics to a zencart
Google gives you 2 ways to verify that you own the site:
- Put a special html page on the site
- Put a special metatag on the index page.
ZenCart automatically makes all 404 “page not found” requests go to the home page or index, so Google says they cannot use method #1 to verify my site. Method #2 is difficult on PHP sites because the source-code is not the same as what you see when you click on the “view page source” button. So with some research on http://www.zen-cart.com/forum/ I found out exactly where to make the changes to get the GoogleAnalytics to work.
You will see that this is not exactly intuitive.
In the site/includes/language/english/meta-tags.php
I edited the following lines:
// page title
define(’TITLE’, ‘Halton Security Institute, Network Defense Section’);// Site Tagline
define(’SITE_TAGLINE’, ‘Now, You Don Not Have to Just Hope Your Systems are Secure’);// Custom Keywords
define(’CUSTOM_KEYWORDS’, ‘Network security, open source, ecommerce, Wolf Halton’);// Review Page can have a lead in:
define(’META_TAGS_REVIEW’, ‘Reviews: ‘);..and placed this line in below
//Wolfs attempt to add GoogleAnalytics
define(’META_TAG_VERIFY-VL’, ‘Whatever Google says this value should be’);
Now there is a file called: site/includes/templates/YOUR_TEMPLATE/common/html_header.php and I can put a tag into it that calls the variable I just put into the file above, however I could also put the <meta name=”verify-v1″ content=”Whatever Google says it should be” /> directly in there, and it will show up on the source for the page.
This seems a more straightforward way to place the tag than to make a variable for it, and it also guarantees that google won’t see the tag 1000 times on the site. Now I get to see if Google can see my hack.
The answer: You’ve successfully verified http://networkdefense.biz/.
Book Mark it-> del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Netscape | Yahoo | BlinkList