setUpWebsitesAndGoals(); $this->trackVisits(); } public function tearDown(): void { // empty } private function setUpWebsitesAndGoals() { if (!self::siteCreated($idSite = 1)) { self::createWebsite($this->dateTime, $ecommerce = 1); } if (!self::goalExists($idSite = 1, $idGoal = 1)) { API::getInstance()->addGoal( $this->idSite, 'Goal 1 - Thank you', 'title', 'Thank you', 'contains', $caseSensitive = false, $revenue = 10, $allowMultipleConversions = 1 ); } if (!self::goalExists($idSite = 1, $idGoal = 2)) { API::getInstance()->addGoal( $this->idSite, 'Goal 2 - Hello', 'url', 'hellow', 'contains', $caseSensitive = false, $revenue = 10, $allowMultipleConversions = 0 ); } if (!self::goalExists($idSite = 1, $idGoal = 3)) { API::getInstance()->addGoal($this->idSite, 'triggered js', 'manually', '', ''); } } private function trackVisits() { $t = self::getTracker($this->idSite, $this->dateTime, $defaultInit = true); // Record 1st page view $t->setUrl('http://example.org/index.htm'); self::checkResponse($t->doTrackPageView('0')); $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.3)->getDatetime()); self::checkResponse($t->doTrackGoal($this->idGoal3, $revenue = 42.256)); } }