1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Page redirect with sub id tracking - clueless

Discussion in 'PHP & Perl' started by thefallendevelopment, May 4, 2010.

  1. thefallendevelopment

    thefallendevelopment Junior Member

    Joined:
    Aug 19, 2008
    Messages:
    170
    Likes Received:
    161
    Occupation:
    Crankin out sites
    Location:
    In the Caddy Shack
    I've been given the wonderful job of setting up multiple pages and now i'm told they need to have sub id tracking.

    Here's my problem...

    I've got 4-5 directories with a single index php page with a redirect to the homepage as soon as someone goes to one of these pages.

    The purpose of the these pages (originally) were to track hits with g analytics to see what ad's worked best.

    NOW, they tell me they need to track these pages with sub id's. I have no idea what or how to do this.

    So it goes from being domain.com/ad1

    to

    domain.com/ad1?=subid

    I can actually goto my site with the ?=subid but i'm not sure if it's working or not.

    Any help would be greatly appreciated.
     
  2. C.S.A.

    C.S.A. Junior Member

    Joined:
    Mar 29, 2010
    Messages:
    150
    Likes Received:
    242
    Modify whatever script you're using to log that too. You haven't posted enough info to help us help you.

    If it were my own server, I'd just parse that out of the apache logs using grep, but that's not as simple as modifying some php script.
     
  3. thefallendevelopment

    thefallendevelopment Junior Member

    Joined:
    Aug 19, 2008
    Messages:
    170
    Likes Received:
    161
    Occupation:
    Crankin out sites
    Location:
    In the Caddy Shack
    Well basically the only PHP on there is

    Code:
    <?php
    
       header( 'Location: http://www.domain.com' ) ;
    
    ?>
    Then there's g analytics code under that php.

    So as soon as the user goes to the domain.com/ad1 page, ganalytics records the hit and forwards them to the main page.

    I'm not sure how to modify this php to accept sub id's. I've searched and i cannot find anything on this.
     
  4. thefallendevelopment

    thefallendevelopment Junior Member

    Joined:
    Aug 19, 2008
    Messages:
    170
    Likes Received:
    161
    Occupation:
    Crankin out sites
    Location:
    In the Caddy Shack
    The receiving page is the main domain. So if i make these pages domain.com/ad1 domain.com/ad2..etc with no analytic code on these pages it will still be tracked from analytics on the homepage?

    The pages with redirects are for advertisement tracking. The campaign agency said they need to be able to add sub ids. And i just don't have a clue how to make a page that is/will be a sub id acceptable page.

    As you can see, i have no clue as what i'm doing so....can't really explain it better.