problem with tracking code

9 replies
hey friend,
I m just facing some problem with my tracking code..i have a website which is made in wordpress...i have just run a campaign here..just want to track how many visitor i recieved for my particular ad..here is php file i m using to redirect pls have a look and suggest if i m missing something..

<html>
<body>

Here my google analytic tracking code is given
<?php

header( Location: "Website url given here" ) ;

?>
</body>
</html>


Am I missing something here...pls suggest.

FYI: Redirect is working fine but tracking is not working..
#code #problem #tracking
  • Profile picture of the author aaron_nimocks
    Try adding your

    <head>
    </head>

    tags also. I had this same problem and I needed to add HTML, HEAD, BODY tags for it to work for me.
    Signature

    My free PSD logs can be downloaded at PSD Bum. Enjoy!

    {{ DiscussionBoard.errors[3245782].message }}
    • Profile picture of the author rajivkumar900
      Originally Posted by aaron_nimocks View Post

      Try adding your

      <head>
      </head>

      tags also. I had this same problem and I needed to add HTML, HEAD, BODY tags for it to work for me.
      should i put my tracking code in under head tag ?
      or just put head tag ?
      Signature

      Rajiv Kumar
      Skpe: rajivkumar900
      Email id : rajivkumar900@gmail.com

      {{ DiscussionBoard.errors[3245874].message }}
      • Profile picture of the author aaron_nimocks
        Just like below.

        PHP Code:
        <html>
        <head>
        <title>Redirecting.....</title>
        </head>
        <body>
        <?php headerLocation"Website url given here" ) ; ?>
        </body>
        </html>
        I don't know if this will work. But I did have the same issue as you and couldn't figure out why. Once I put in all the basic HTML tags it seemed to work.
        Signature

        My free PSD logs can be downloaded at PSD Bum. Enjoy!

        {{ DiscussionBoard.errors[3245886].message }}
        • Profile picture of the author rajivkumar900
          Originally Posted by aaron_nimocks View Post

          Just like below.

          PHP Code:
          <html>
          <head>
          <title>Redirecting.....</title>
          </head>
          <body>
          <?php headerLocation"Website url given here" ) ; ?>
          </body>
          </html>
          I don't know if this will work. But I did have the same issue as you and couldn't figure out why. Once I put in all the basic HTML tags it seemed to work.
          pls confirm where i need to put my tracking code..i think it doesnt matter whether we put code in header or body ?
          pls advice
          Signature

          Rajiv Kumar
          Skpe: rajivkumar900
          Email id : rajivkumar900@gmail.com

          {{ DiscussionBoard.errors[3245898].message }}
          • Profile picture of the author aaron_nimocks
            Originally Posted by rajivkumar900 View Post

            pls confirm where i need to put my tracking code..i think it doesnt matter whether we put code in header or body ?
            pls advice

            Ohh ya. Right above the </body> tag

            If this doesn't work. Then add it right above the redirect code. It could be that it's redirecting before it reaches the code to track. I also did a header refresh and added a 2 second delay. Might need to add a delay also to track properly.
            Signature

            My free PSD logs can be downloaded at PSD Bum. Enjoy!

            {{ DiscussionBoard.errors[3245905].message }}
            • Profile picture of the author rajivkumar900
              Problem still not solved..i have test to put my tracking code in head tag as well but its not working too...
              i dont know how to add time eliment with php redirect can you help me in it..or if you dont mind can i send you my php files to see what exactly i m using and why this problem is coming..little more help is appreciated friend.
              Signature

              Rajiv Kumar
              Skpe: rajivkumar900
              Email id : rajivkumar900@gmail.com

              {{ DiscussionBoard.errors[3246719].message }}
              • Profile picture of the author aaron_nimocks
                Try a meta refresh instead. Remove your code and put this in between the <head></head>

                PHP Code:
                <meta http-equiv="refresh" content="1;url=http://example.com/" /> 
                Replace 1 with the second delay before it refreshes and the url with yours. I would just leave at 1 second.
                Signature

                My free PSD logs can be downloaded at PSD Bum. Enjoy!

                {{ DiscussionBoard.errors[3246755].message }}
  • Profile picture of the author nvs74191
    Hey Rajiv

    Why don't you track your clicks with a bit.ly url instead?
    Signature

    Swaminathan

    I am a Jack Duncan Fan!

    {{ DiscussionBoard.errors[3251467].message }}
    • Profile picture of the author rajivkumar900
      Originally Posted by nvs74191 View Post

      Hey Rajiv

      Why don't you track your clicks with a bit.ly url instead?
      hello sir, thanks for the suggestion but i was just trying to learn what i m missing..that is why i have posted here..bitfly is one of the best thing can done ..just a bit learning to go to next level..
      I m happy to see you came here to give your helping hand..I must say i got real help last time as well.
      Thanks for being around me whenever i need you..
      Rajiv
      Signature

      Rajiv Kumar
      Skpe: rajivkumar900
      Email id : rajivkumar900@gmail.com

      {{ DiscussionBoard.errors[3251488].message }}

Trending Topics