You are here:  » Capturing click Date and Time

Support Forum



Capturing click Date and Time

Submitted by Convergence on Mon, 2012-10-15 16:18 in

Greetings,

We would like to capture the date and time of a click and append it to the affiliate URL as the SID in a format that is readable and makes sense. This would allow us to know how long after the click the sale occurred.

Currently we are using the "Text After" filter to bring in the install location where we have the merchant.

Example: &SID=BlueWidgets

We would like &SID=BlueWidgets-15Oct2012-231453 (where 2314 is the 24 hour format representing 11:14PM and the 53 is the seconds).

Possible?

Thanks!

Submitted by support on Mon, 2012-10-15 18:05

Hi,

Sure - you could do this by first using the Text After filter as currently but with a placeholder for date/time e.g.

&SID=BlueWidgets-%DATETIME%

Then to replace that out when the link is clicked, in jump.php look for the following code at line 8:

  $product = $rows[0];

...and REPLACE with:

  $product = $rows[0];
  $product["buy_url"] = str_replace("%DATETIME%",date("jMY-His"),$product["buy_url"]);

"jMY-His" is the date format as per PHP's date() function.

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Convergence on Mon, 2012-10-15 18:38

Hi David,

Thanks!

Quick question: If we make the changes now, and do not re-import the feeds until the next CRON, will there be any problems with clicks that occur until the next import?

Just want to make sure we don't have to immediately import the feeds again to prevent something breaking.

Thanks, again!

Submitted by support on Mon, 2012-10-15 18:56

Hi,

No problem making changes now - %DATETIME% won't appear in the links until next import anyway, and if a link doesn't contain the placeholder it's not affected anyway - so that's fine!

Cheers,
David.
--
PriceTapestry.com

Submitted by Convergence on Wed, 2012-10-24 03:46

Hi David,

Works like a charm!

Thanks!