/**
  * @Route("/check_analytics", name="Check Analytics Profile")
  */
 public function indexAction(Request $request)
 {
     if ($request->query->get('profile_id')) {
         $profileId = $request->query->get('profile_id');
         $this->analyticsService = $this->get('AnalyticsService');
         $this->analyticsService->setProfileId($profileId);
         $this->analyticsService->checkProfile();
     }
     // replace this example code with whatever you need
     return $this->render('default/index.html.twig', array());
 }
Exemple #2
0
 /**
  * @param $request
  * @return mixed
  */
 public function getCollectionRequest($request)
 {
     $this->resetResponse();
     $this->addGaRequestCount();
     $response = $this->analyticsService->getRequest($request);
     if ($this->analyticsService->getError()) {
         $this->error = $this->analyticsService->getError();
         return;
     }
     if (!$response) {
         $this->error = 'Missing GA response!';
         return;
     }
     $this->response = $response;
     return parent::getCollectionRequest($request);
 }