- Fixes click tracking that would end request when calling open tracking
This commit is contained in:
@ -32,6 +32,7 @@ class Clicks {
|
|||||||
if(!$statistics) {
|
if(!$statistics) {
|
||||||
// track open action in case it did not register
|
// track open action in case it did not register
|
||||||
$opens = new Opens($url);
|
$opens = new Opens($url);
|
||||||
|
$opens->display_image = false;
|
||||||
$opens->track();
|
$opens->track();
|
||||||
$statistics = StatisticsClicks::create();
|
$statistics = StatisticsClicks::create();
|
||||||
$statistics->newsletter_id = $newsletter_id;
|
$statistics->newsletter_id = $newsletter_id;
|
||||||
|
@ -8,6 +8,7 @@ if(!defined('ABSPATH')) exit;
|
|||||||
|
|
||||||
class Opens {
|
class Opens {
|
||||||
public $data;
|
public $data;
|
||||||
|
public $display_image = true;
|
||||||
|
|
||||||
function __construct($data) {
|
function __construct($data) {
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
@ -30,10 +31,12 @@ class Opens {
|
|||||||
$statistics->queue_id = $queue_id;
|
$statistics->queue_id = $queue_id;
|
||||||
$statistics->save();
|
$statistics->save();
|
||||||
}
|
}
|
||||||
header('Content-Type: image/gif');
|
if ($this->display_image) {
|
||||||
// return 1x1 pixel transparent gif image
|
// return 1x1 pixel transparent gif image
|
||||||
echo "\x47\x49\x46\x38\x37\x61\x1\x0\x1\x0\x80\x0\x0\xfc\x6a\x6c\x0\x0\x0\x2c\x0\x0\x0\x0\x1\x0\x1\x0\x0\x2\x2\x44\x1\x0\x3b";
|
header('Content-Type: image/gif');
|
||||||
exit;
|
echo "\x47\x49\x46\x38\x37\x61\x1\x0\x1\x0\x80\x0\x0\xfc\x6a\x6c\x0\x0\x0\x2c\x0\x0\x0\x0\x1\x0\x1\x0\x0\x2\x2\x44\x1\x0\x3b";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function abort() {
|
private function abort() {
|
||||||
|
Reference in New Issue
Block a user