protected function getProfileIdByTrackingId(&$analytics, $tracking_id)
	{
		$accounts = $analytics->management_accounts->listManagementAccounts();
		
		foreach ($accounts->getItems() as $item)
		{
			$account_id = $item->getId();
			if ($account_id != $tracking_id) continue;
			
			$properties = $analytics->management_webproperties->listManagementWebproperties($account_id);
			
			if (sizeof($properties->getItems()) > 0)
			{
				$items = $properties->getItems();
				$first_property_id = $items[0]->getId();
				
				$profiles = $analytics->management_profiles
					->listManagementProfiles($account_id, $first_property_id);
				
				if (sizeof($profiles->getItems()) > 0)
				{
					$items = $profiles->getItems();
					return $items[0]->getId();
				}
			}
		}
		
		return null;
	}