Skip to content

Commit e403f27

Browse files
TMONE-894 - add trackers
1 parent 3296f3e commit e403f27

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ $trackingInfo->setUserAgent ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/53
147147
$trackingInfo->setUserIPAddress ('10.0.2.2');
148148
$trackingInfo->setUserLanguage ('en-US,en;q=0.8,uk;q=0.6,ru;q=0.4');
149149
$trackingInfo->setUserLocalTime ('Tue May 27 2014 10:31:05 GMT+0300 (EEST)');
150+
$trackingInfo->setTrackers (array(
151+
"ga" => "GA1.1.1479631296.1738839056"
152+
));
150153

151154
$order->setTrackingInfo ($trackingInfo);
152155

src/API2Client/Entities/Order/TrackingInfo.php

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ class TrackingInfo
9797
*/
9898
protected $tSource;
9999

100+
/** @var array */
101+
private $trackers;
102+
100103
/**
101104
* @param string $affiliateName
102105
*/
@@ -354,21 +357,37 @@ public function getWebdesignTime ()
354357
}
355358

356359
/**
357-
* @param \API2Client\Entities\Order\TrackingTSource $tSource
360+
* @param TrackingTSource $tSource
358361
*/
359362
public function setTSource (TrackingTSource $tSource)
360363
{
361364
$this->tSource = $tSource;
362365
}
363366

364367
/**
365-
* @return \API2Client\Entities\Order\TrackingTSource
368+
* @return TrackingTSource
366369
*/
367370
public function getTSource ()
368371
{
369372
return $this->tSource ? $this->tSource : new TrackingTSource ();
370373
}
371374

375+
/**
376+
* @param array $trackers
377+
*/
378+
public function setTrackers (array $trackers)
379+
{
380+
$this->trackers = $trackers;
381+
}
382+
383+
/**
384+
* @return array
385+
*/
386+
public function getTrackers ()
387+
{
388+
return (array)$this->trackers;
389+
}
390+
372391
/**
373392
* @return array
374393
*/
@@ -392,6 +411,7 @@ public function toArray ()
392411
'utmCampaign' => $this->getUtmCampaign (),
393412
'webdesign' => $this->getWebdesign (),
394413
'webdesignTime' => $this->getWebdesignTime (),
414+
'trackers' => $this->getTrackers (),
395415
);
396416
}
397-
}
417+
}

0 commit comments

Comments
 (0)