Beispiel #1
0
 /**
  * Keep a record of a tracked CTA and queue it for replacement
  *
  * @param CTA $cta
  */
 public function addTrackedCTA(CTA $cta)
 {
     $this->trackedCTAs[] = $cta;
     $this->queueForReplacement($cta->getOriginalUrl(), $cta->getExpandedUrl(), $cta->getTrackingUrl(), $cta->getShortenedTrackingUrl());
 }
Beispiel #2
0
 /**
  * @param $url
  * @param Operation $operation
  * @param Location|null $location
  * @return CTA
  */
 protected function createCTA($url, Operation $operation, Location $location = null)
 {
     $cta = new CTA();
     $cta->setOperation($operation);
     $cta->setOriginalUrl($url);
     $cta->setExpandedUrl($this->expandUrl($url));
     if ($location) {
         $cta->setLocation($location);
         $cta->setTrackingId($this->generateTrackingId());
         $cta->setTrackingUrl($this->generateTrackingUrl($cta->getExpandedUrl(), $cta->getTrackingId()));
         $cta->setShortenedTrackingUrl($this->getShortenedUrl($cta->getTrackingUrl()));
     }
     return $cta;
 }