Results 1 to 11 of 11

 

Thread: Tracking help needed

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cornwall
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts


    I'm trying to work out how to add tracking to my links but can't figure a way to do it. Products are called dynamically from datafeeds using php. Is there a way I can add tracking in the same way, e.g. by using the brand column.

    Tracking is usually added onto the end of the affiliate link and as these only appear when called I don't know how to add it without going into the datafeed and editing every single product. Hope that makes sense. I can provide code if it helps show what I mean. Thanks.

  2. #2
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    shouldn't be too tricky

    what links do you have in your database? full tracking links that include the network code and then the deeplink to product, or just the deeplink to product then you add the network bit later?

    should just be a case of replacing bits and bobs.

    on some of my sites when I import feeds I get the script to add like a null tracking bit, so all the links would have &epi=##TRACK## or something in the middle of them, then as they get displayed that gets changed to include, dates, times, the page it was loaded onto, anything really.
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cornwall
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I mainly use the AF feeds and Awin feed so they include all the network stuff. An example php call would be:
    Code:
    <a href="<?php echo $row_Recordset1['deepLink']; ?>" target="_blank"><b>Buy This Item</b></a>
    Any thoughts?

  4. #4
    Registered User

    Status
    Offline
    Join Date
    Mar 2004
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts
    with the awin feeds I just insert the product id into the deeplink like this

    $deepLink = $row["deepLink"];
    $offerID = $row["offerID"];

    $deepLink = str_replace("awinaffid=xxxxx","awinaffid=xxxxx&cli ckref=$offerID",$deepLink);

    echo"<a href=\"$deepLink\" target=\"_blank\"><b>Buy This Item</b></a>";


    then I can see which item has been sold from the clickref

    of course you could use the product name, price, category, time of day etc instead of or in addition to the product id

  5. #5
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    yeah just do string replaces, so for the AF feeds ones...

    (as their links have the tracking already in, but not set at anything)

    <? $row_Recordset1['deepLink'] = str_replace("&tracking=","&tracking=OWT_YOU_WANT_H ERE",$row_Recordset1['deepLink']); ?>

    and put that just before your link code.
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  6. #6
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cornwall
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay thanks guys, seems straightforward enough. One other question. I'd want to use something like the brand name as tracking which for example would be called
    Code:
    $row_Recordset1['brand']
    so would this look right?
    Code:
    <? $row_Recordset1['deepLink'] = str_replace("&tracking=","&tracking=$row_Recordset1['brand']",$row_Recordset1['deepLink']); ?>

  7. #7
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    looks fine to me

    but if you want to add more than just the brand as tracking, like you want to put the time of the click in id make a seperate variable first so...

    <?
    $tracking = $row_Recordset1['brand']."_".date("G:i");
    $row_Recordset1['deepLink'] = str_replace("&tracking=","&tracking=$tracking",$ro w_Recordset1['deepLink']); ?>

    and your tracking would be like Sony_18:24
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  8. #8
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cornwall
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay I inserted the code in my last post just before the first link and I'm getting the following error.
    Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
    I can't see what's wrong with this code. Anyone?

  9. #9
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cornwall
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Any suggestions please?

  10. #10
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    try swapping...

    <?
    $tracking = $row_Recordset1['brand']."_".date("G:i");
    $row_Recordset1['deepLink'] = str_replace("&tracking=","&tracking=$tracking",$ro w_Recordset1['deepLink']); ?>

    with


    <?
    $tracking = $row_Recordset1['brand'];
    $tracking .= "_";
    $tracking .= date("G:i");
    $row_Recordset1['deepLink'] = str_replace("&tracking=","&tracking=$tracking",$ro w_Recordset1['deepLink']); ?>

    edit: just re-read your post, using the code you posted, try swapping the $row_Recordset1['deepLink'] for a more simple variable, maybe... so before your code:

    $link = $row_Recordset1['deepLink'];

    then just use $link
    Last edited by morleymouse; 05-05-05 at 02:38 PM.
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  11. #11
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cornwall
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay played with this a bit more and although I could get rid of the error doing what you suggest the link still doesn't show tracking.

    It was then I realised I could do this easier (muppet!) at least with the AF feeds. Got that one sorted.

    The Awin feed is a bit trickier I think. The network details and deeplink are built into the feed so I've added
    Code:
    &clickref=<?php echo $row_Recordset1['brand']; ?>
    directly after the call for the deeplink. The tracking is correctly added after the link and testing the link it goes to the correct page. What I need to know is does this register clicks properly adding tracking at the end of the link and if so where should it show in the Awin stats as I can't find it?



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2