Zen Cart Logo
Forums / General Questions / edit <head> of main page only for split testing

edit <head> of main page only for split testing

Views: 567

Results 1 to 3 of 3
20 Apr 2015, 5:09 PM
#1
thomaswhiteeagle avatar

thomaswhiteeagle

New Zenner

Join Date:
May 2007
Posts:
93
Plugin Contributions:
0

edit <head> of main page only for split testing

I've figured out a way to split test the main page of zencart using google analytics by using ezpages for my test page(s) if I can add the Ga code to the home page only. What I cannot figure out and answers/discussions on the forum in this regard are unclear is how to have some specific code added between the opening and closing head tag of the main page only. Anyone have any ideas on how I can make it possible to have specific code in between the opening and closing head tags of the main page only?

20 Apr 2015, 6:11 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,096
Plugin Contributions:
56

Re: edit <head> of main page only for split testing

Add the following code fragment (with appropriate <?php and ?> tags as required) where you want the home-page-only content inserted?

if ($this_is_home_page) {
 // add your stuff here
}
21 Apr 2015, 6:20 AM
#3
thomaswhiteeagle avatar

thomaswhiteeagle

New Zenner

Join Date:
May 2007
Posts:
93
Plugin Contributions:
0

Re: edit <head> of main page only for split testing

lat9:

Add the following code fragment (with appropriate <?php and ?> tags as required) where you want the home-page-only content inserted?

if ($this_is_home_page) {
// add your stuff here
}


ok, thanks. Far as I can see there is a 'global' header page which encompasses everything between opening and closing head tags which is html_header.php. So my assumption if you are correct then is to put it there, with appropriate php tags.