updateSite() public method

If only one URL is specified then only the main url will be updated. If several URLs are specified, both the main URL and the alias URLs will be updated.
public updateSite ( integer $idSite, string $siteName = null, string | array $urls = null, integer $ecommerce = null, null | integer $siteSearch = null, string $searchKeywordParameters = null, string $searchCategoryParameters = null, string $excludedIps = null, null | string $excludedQueryParameters = null, string $timezone = null, string $currency = null, string $group = null, string $startDate = null, null | string $excludedUserAgents = null, integer | null $keepURLFragments = null, string $type = null, array | null $settingValues = null, boolean | null $excludeUnknownUrls = null ) : boolean
$idSite integer website ID defining the website to edit
$siteName string website name
$urls string | array the website URLs When calling API via HTTP specify multiple URLs via `&urls[]=http...&urls[]=http...`.
$ecommerce integer Whether Ecommerce is enabled, 0 or 1
$siteSearch null | integer Whether site search is enabled, 0 or 1
$searchKeywordParameters string Comma separated list of search keyword parameter names
$searchCategoryParameters string Comma separated list of search category parameter names
$excludedIps string Comma separated list of IPs to exclude from being tracked (allows wildcards)
$excludedQueryParameters null | string
$timezone string Timezone
$currency string Currency code
$group string Group name where this website belongs
$startDate string Date at which the statistics for this website will start. Defaults to today's date in YYYY-MM-DD format
$excludedUserAgents null | string
$keepURLFragments integer | null If 1, URL fragments will be kept when tracking. If 2, they will be removed. If 0, the default global behavior will be used.
$type string The Website type, default value is "website"
$settingValues array | null JSON serialized settings eg {settingName: settingValue, ...}
$excludeUnknownUrls boolean | null Track only URL matching one of website URLs
return boolean true on success
Ejemplo n.º 1
0
 public function testGetAllCachedSiteUrls_ShouldReturnCorrectResultEvenIfItIsCachedAsWeClearTheCacheOnAnyChange()
 {
     $this->addSite('http://www.example.com');
     // only one main URL
     $this->assertCachedSiteUrls(array(1 => array('http://www.example.com')));
     $this->addSite('http://www.example.com', 'http://www.piwik.org');
     // main URL and alias URL
     $this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://www.piwik.org')));
     $this->api->addSiteAliasUrls(2, 'http://piwik.org');
     $this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://piwik.org', 'http://www.piwik.org')));
     $this->api->setSiteAliasUrls(2, array());
     $this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com')));
     $this->api->updateSite(1, 'siteName3', array('http://updated.example.com', 'http://2.example.com'));
     $this->assertCachedSiteUrls(array(1 => array('http://updated.example.com', 'http://2.example.com'), 2 => array('http://www.example.com')));
 }