HELP - Inserting Google Analytics in index.php

12 replies
Hi Guys,

My Index.php page is as follow:

<?php
define( "KVSP_HOSTED", __FILE__ );
define( "KVSP_PATH", "kvsp/" );
require_once( KVSP_PATH . "load.php");
?>

Where do I put my code and will it corrupt the file? Can you paste exactly how it should look?

Help appreciated.
#analytics #google #indexphp #inserting
  • Profile picture of the author dwoods
    Hi martin_boyd, what type of framework/cms is this?
    {{ DiscussionBoard.errors[7151945].message }}
  • Profile picture of the author martin_boyd
    Hi

    Thanks for the reply

    Its a simple video squeeze page, so not a CMS. Not sure about framework, not that technical buddy.

    Was really hoping it was simple :confused:

    The signature link takes you to the site I want to add it too if that helps?

    Any help appreciated.
    {{ DiscussionBoard.errors[7151971].message }}
  • Profile picture of the author tweakr
    Was the site custom built for you?

    Unfortunately you won't be able to just add your analytics code to that index file. There must be other files somewhere that contain the design/layout of the site, that is what you'll need to find for this.

    I'm not familiar with anything using "KVSP", if you could provide us more information about the directory structure or anything maybe we would be able to help you more.
    {{ DiscussionBoard.errors[7152015].message }}
  • Profile picture of the author martin_boyd
    I have a setup.css page as below:


    html{background:#f9f9f9;}
    body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em auto;width:700px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}
    a{color:#2583ad;text-decoration:none;}
    a:hover{color:#d54e21;}
    h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}
    h2{font-size:16px;}
    p,li,dd,dt{padding-bottom:2px;font-size:12px;line-height:18px;}
    code,.code{font-size:13px;}
    ul,ol,dl{padding:5px 5px 5px 22px;}
    a img{border:0;}
    abbr{border:0;font-variant:normal;}
    #logo{margin:6px 0 14px 0;border-bottom:none;text-align:center;}
    .step{margin:20px 0 15px;}
    .step,th{text-align:center;padding:0;}
    .submit input,.button,.button-secondary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}
    .button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}
    .button,.submit input,.button-secondary{background:#f2f2f2 url(../images/button-gradient-yellow.png) repeat-x scroll left top;}
    .button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/button-gradient-yellow2.png) repeat-x scroll left top;}
    textarea{border:1px solid #bbb;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}
    .form-table{border-collapse:collapse;margin-top:1em;width:100%;}
    .form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}
    .form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:130px;vertical-align:top;}
    .form-table tr{background:#f3f3f3;}
    .form-table code{line-height:18px;font-size:18px;}
    .form-table p{margin:4px 0 0 0;font-size:11px;}
    .form-table input{line-height:20px;font-size:15px;padding:2px;}
    .form-table th p{font-weight:normal;}
    #error-page{margin-top:50px;}
    #error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}
    #error-page code,.code{font-family:Consolas,Monaco,Courier,monospace;}
    .message{border:1px solid #e6db55;padding:.3em .6em;margin:5px 0 15px;background-color:#ffffe0;}
    .middle{text-align:center;}

    Can i put it here anywhere?
    {{ DiscussionBoard.errors[7152037].message }}
  • Profile picture of the author dwoods
    martin_boyd, I see. It probably is a very easy thing to do. But what is the site built on? Is it wordpress, or some other type of CMS software? Was it created custom just for you?

    Hit me on skype and l'd be happy to take a look for you. (link to the left)

    Regards,
    {{ DiscussionBoard.errors[7152082].message }}
    • Profile picture of the author martin_boyd
      Originally Posted by dwoods View Post

      martin_boyd, I see. It probably is a very easy thing to do. But what is the site built on? Is it wordpress, or some other type of CMS software? Was it created custom just for you?

      Hit me on skype and l'd be happy to take a look for you. (link to the left)

      Regards,
      Hi Darren, just tried Skype, connection was poor.

      Sorry I cannot be more specific here. It was custom built.

      What would be the best way to implement google analytics on a site like this?
      {{ DiscussionBoard.errors[7152114].message }}
  • Profile picture of the author tweakr
    No, you won't be able to paste it in the CSS.

    Is there a folder somewhere that is called something like templates or themes. Look for something like this, if you can find that look at those files to see if they contain the layout.
    {{ DiscussionBoard.errors[7152142].message }}
  • Profile picture of the author ours
    Is it possible to share site link so that can check.
    {{ DiscussionBoard.errors[7152186].message }}
  • Profile picture of the author dwoods
    You should be all fixed up man.
    For those interested it was built on a framework called KVSP, or killervideosqueezepages.com
    {{ DiscussionBoard.errors[7152209].message }}
    • Profile picture of the author martin_boyd
      Darren, You are an absolute star mate. Thanks again.
      {{ DiscussionBoard.errors[7152244].message }}
  • Profile picture of the author balado1
    Darren and Martin
    I need exactly the same information that was discuss here with exactly the same product i.e. KSVP. Could you please help me out and tell me where to put the google analytics on this type of site, your help would be much appreciated.

    Thank you
    Geoff Barlow
    {{ DiscussionBoard.errors[7951004].message }}
  • Profile picture of the author ZackAllen
    You can paste GA code anywhere before </body> tag. Best place to insert GA code is html header section.
    html header section ise between <head> and </head> tags. paste the GA code before </head> tag...
    note: GA code must not be inside <?php and ?> tags
    {{ DiscussionBoard.errors[7965709].message }}

Trending Topics