Author Topic: Question about link tracking  (Read 4888 times)

mike2

  • Posts: 193
    • View Profile
Question about link tracking
« on: July 22, 2006, 02:40:54 pm »
I have "track users" enabled in my link tracking, I want to delete some of my tracked links cause the db is getting big and a bit bulky (well not really too big, but I wanna get rid of some old links).

My question is if I delete the link will the clicks that were tracked be deleted properly also?

In other words I don't want to go deleting a bunch of my old tracked links if the tracked clicks don't get deleted with it also as this would just keep a bunch of junk around, does this make sense Dean?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Question about link tracking
« Reply #1 on: July 23, 2006, 01:27:33 am »
At this time hits are not removed when you remove links (good suggestion, though - I just added it!)

In link.php, around line 120, change:
Code: [Select]
if($dodel == 'yes'){
 $cmd = "delete from $ktable where id = '$delid'";
 if($demo<>'yes'){
  mysql_query($cmd);
  $logtxt = "$dtitle link deleted.";
 } else {
  $logtxt = "Cannot delete link in demo.";
 }
}

to:
Code: [Select]
if($dodel == 'yes'){
 $cmd = "delete from $ktable where id = '$delid'";
 if($demo<>'yes'){
  mysql_query($cmd);
  mysql_query("delete from $htable where kid = '$delid';");
  $logtxt = "$dtitle link and tracked hits deleted.";
 } else {
  $logtxt = "Cannot delete link in demo.";
 }
}

Your old hits should also be removed automatically by dailymail as per the "Keep X tracked hits" maintenance setting on the Config page.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Question about link tracking
« Reply #2 on: July 23, 2006, 01:10:30 pm »
Hey DW,

Code: [Select]
Code:
if($dodel == 'yes'){
 $cmd = "delete from $ktable where id = '$delid'";
 if($demo<>'yes'){
  mysql_query($cmd);
  $logtxt = "$dtitle link deleted.";
 } else {
  $logtxt = "Cannot delete link in demo.";
 }
}


Your two code pieces are IDENTICAL!!!  

Please post the correct updates, so I can make the changes too.
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Question about link tracking
« Reply #3 on: July 23, 2006, 03:10:48 pm »
Brett,

Look closely - these lines were added:
Code: [Select]
 mysql_query("delete from $htable where kid = '$delid';");
  $logtxt = "$dtitle link and tracked hits deleted.";

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Question about link tracking
« Reply #4 on: July 23, 2006, 07:48:40 pm »
Hi,

Quote
Look closely - these lines were added:


Sorry about that... must be weekend eyes...  I'll look closer next time...

This little piece is great, and just what I need, I think.... actually a way to CLEAR them all out, since I do that manually - might be better... or also should be included on the 'Config Page'?
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Question about link tracking
« Reply #5 on: July 24, 2006, 12:38:45 am »
Here's some code to clear out hits from non-existent links.  Upload it as a PHP file in your ListMail folder and browse to it:
Code: [Select]
<?phpinclude('./config.php');include('./admin.php');$rows = mysql_query("select id,kid from $htable where 1");while(list($hid,$kid)=mysql_fetch_row($rows)){ list($cnt)=mysql_fetch_row(mysql_query("select count(*) from $ktable where id = '$kid';")); if($cnt==0) mysql_query("delete from $htable where kid = '$kid';");}?>

If you need to do anything else let me know.
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

BGSWebDesign

  • Posts: 625
    • View Profile
    • http://www.bgswebdesign.com
Question about link tracking
« Reply #6 on: July 24, 2006, 06:07:04 am »
Hi DW,

Quote
Here's some code to clear out hits from non-existent links


Thanks, that's great, I've been doing it manually in PhpMyAdmin all this time!

Quote
If you need to do anything else let me know.


Uhhhh... yeah, I can think of about 30-40 things,  :lol:  I combined them into my top 10, I'm still waiting for some of them to get worked on, especially the Bounce Recovery feature that would let me move Bounced Users to a Recovery list that is emailed a new set of followups asking the user if they are still interested.

Better link tracking... you know what I want from that!  The whole thing, including tracking through to the purchase... yes, I really, REALLY, REALLY need that, and also better statistics...

You know you can find all of my detailed posts on these issues up here...  hey, BTW, what's on schedule for the next release?
Thanks,
-Brett
http://www.bgswebdesign.com/Contact-Us.php

*** I do custom List Mail Pro installations ***
Contact me through my website (above)