Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Friendly URLs Yahoo stats ?

  1. #1
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default Friendly URLs Yahoo stats ?

    I have a client that hosts with Yahoo small business. Their site stats are not working even though I've added the required code for php pages.
    I'm using a rewrite that says basically if ../index is requested it loads the ../index.php page without the extension visible.


    .htaccess file:
    Code:
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php
    When visiting the site if I add the .php extension the yahoo stats track the visit.

    Google Analytics on this site works. AWSTATS work fine for another site using the same rewrite code.

    Here's the yahoo stats code:
    Code:
    <script language="JavaScript"
    src="http://l.yimg.com/a/lib/smb/js/hosti...ce/whv2_001.js"> 
    </script>
    <script language="javascript">geovisit();</script>
    <noscript><img src="http://visit.webhosting.yahoo.com/visit.gif?time"
    alt="setstats" border="0" width="1" height="1"></noscript>
    Any ideas or solutions?

    Thanks in advance!!
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  2. #2
    jmarcv's Avatar
    jmarcv is offline Cranky Coder
    Join Date
    Jan 2005
    Posts
    354

    Default

    what does this return on your page?

    echo $_SERVER['PHP_SELF'];

  3. #3
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    /index.php
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  4. #4
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    Would this code mess the tracker up?

    PHP Code:
    <?php function page()
    {
    $page substr(strrchr($_SERVER['PHP_SELF'],'/'),1,-1);
    return 
    $page;
    }
    ?>
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  5. #5
    jmarcv's Avatar
    jmarcv is offline Cranky Coder
    Join Date
    Jan 2005
    Posts
    354

    Default

    Not sure what you are trying to accomplish in yor last code.

    OK, so heres my thought. Yahoo gets the referrer as sent by apache. And that is, index

    So try this:
    Remove the tracker from index.php

    At the top of index.php put this in
    PHP Code:
    if ($_GET['tracker']==1){
     include 
    'tracker.inc'
     
    exit;

    At the bottom:
    PHP Code:
    echo '<iframe src="'.$_SERVER['PHP_SELF'].'?tracker=1" style="width:0px;height:0px;display:none;"></iframe>'
    Now, create a file called tracker.inc that looks like this with the tracker code:
    Code:
    <script language="JavaScript"
    src="http://l.yimg.com/a/lib/smb/js/hosti...ce/whv2_001.js"> 
    </script>
    <script language="javascript">geovisit();</script>
    <noscript><img src="http://visit.webhosting.yahoo.com/visit.gif?time"
    alt="setstats" border="0" width="1" height="1"></noscript>
    The theory
    index loads with $tracker set to NULL.
    Top include is ignored.
    Then it loads an invisible iframe, which loads index.php?tracker=1. So the Yahoo code loads in the iframe where the php extension is visible and it should get tracked.
    In this way, you can load this on any page, or even in your header.inc and footer.inc and it is 100% recyclable.

  6. #6
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    John-Marc -
    I like this however, he has Google Analytics also so if I load the index.php page into the iframe, Google picks up both index and index.php.
    I was thinking if I created an index1.php with the tracking code in that page and then load that in the iframe, yahoo would track index1.php and Google would track index.
    But it doesn't seem to be working in the yahoo stats.

    Any other thoughts?
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  7. #7
    jmarcv's Avatar
    jmarcv is offline Cranky Coder
    Join Date
    Jan 2005
    Posts
    354

    Default

    >however, he has Google Analytics also
    If you load google stuff in the index part or the include? If it is only in the include like yahoo, I don't see how it will get the parent location. But I was thinking Google would be loaded in the footer and not from the iframe - opposite of Yahoo.

    No I really dont think there are other ways.

  8. #8
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    John-Marc,

    I am trying to use your method above for another scenario and have a slight issue...

    I want a newsletter form to reside on index2.php
    1) If it hasn't been submitted I want it to display the form
    2) If it's submitted and not correct I want the form to display with an error message
    3) If it's submitted and correct I just want it to say "thanks" and not display form.

    Here's the code I have:
    PHP Code:
    <?php
        
    if ($_POST['submit']==''){
      include 
    'include/passport_signup.html';
     }
      if ((
    $_POST['submit']=='Send Me Deals!') || ($_GET['page']==1)){ 
      echo 
    "Thank You";
      
     }
     if (
    $_GET['page']==2){ 
      echo 
    "Please enter a valid email address";
      
     }
    ?> 
    Can you help?
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  9. #9
    jmarcv's Avatar
    jmarcv is offline Cranky Coder
    Join Date
    Jan 2005
    Posts
    354

    Default

    Yes I can help, but you will need to be a bit more specific with what exactly you need help with.
    1. looks good. 2 & 3, no clue what or how or anything about $_GET['page']

    And no clue what this has to do with google

  10. #10
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    1) Works fine

    2) & 3) The form is processed on icontact's service... I added the index.php?page=1 and index.php?page=2 to try to get the code to work with the php I had above, here it is again for an easier read:

    PHP Code:
    <?php
    if ($_POST['submit']==''){
    include 
    'include/passport_signup.html';
    }
    if ((
    $_POST['submit']=='Send Me Deals!') || ($_GET['page']==1)){ 
    echo 
    "Thank You";
     
    }
    if (
    $_GET['page']==2){ 
    echo 
    "Please enter a valid email address";
     
    }
    ?>
    Here's the form code:
    HTML Code:
    <form method=post action="https://app.icontact.com/icp/signup.php" name="icpsignup" id="icpsignup1904" accept-charset="UTF-8" onsubmit="return verifyRequired1904();" >
    <input type=hidden name=redirect value="http://www.123easyprints.com/index2.php?page=1" />
    <input type=hidden name=errorredirect value="http://www.123easyprints.com/index2.php?page=2" />
    <div style="width:128px;">
    <table width="128" class="leftnav_main" border="0" cellspacing="0" cellpadding="0">
     <tr>
          <td align=center valign="middle">
            <input name="fields_email" type=text value="e-mail address" size="15" class="smaller">
          </td>
        </tr>
        <input type=hidden name="listid" value="27203">
        <input type=hidden name="specialid:27203" value="P86X">
        <input type=hidden name=clientid value="604695">
        <input type=hidden name=formid value="1904">
        <input type=hidden name=reallistid value="1">
        <input type=hidden name=doubleopt value="1">
     
        <tr>
          <td align="center" valign="middle"><input type="submit" name="Submit" value="Send Me Deals!" class="smaller"></td>
        </tr>
        </table>
    </div>
    </form>
    <script type="text/javascript">
    var icpForm1904 = document.getElementById('icpsignup1904');
    if (document.location.protocol === "https:")
     icpForm1904.action = "https://app.icontact.com/icp/signup.php";
    function verifyRequired1904() {
      if (icpForm1904["fields_email"].value == "") {
        icpForm1904["fields_email"].focus();
        alert("The Email field is required.");
        return false;
      }
     
    return true;
    }
    </script>
    I want the form and the results on the same page.

    Has nothing to do with google.

    Thanks!
    Last edited by rlhanson; 11-25-2009 at 08:36 PM. Reason: google clarification
    Thank you,
    Lynne Hanson
    RL Hanson-Online

Page 1 of 2 12 LastLast

Similar Threads

  1. test website stats question
    By ed_meyer in forum WHM, Resellers, VPS and Dedicated Hosting Topics
    Replies: 8
    Last Post: 12-28-2008, 07:39 AM
  2. How to add your site to google and Yahoo!
    By Matt in forum Search Engines Talk
    Replies: 5
    Last Post: 08-03-2007, 04:00 PM
  3. Replies: 1
    Last Post: 03-17-2005, 05:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16