| CampaignServiceSetCampaign Method  | 
 
Namespace: CMS.WebAnalyticsAssembly: CMS.WebAnalytics (in CMS.WebAnalytics.dll) Version: 13.0.131
Syntaxpublic void SetCampaign(
	string campaignCode,
	string siteName,
	string source = null,
	string content = null
)
Parameters
- campaignCode
 - Type: SystemString
Name of the campaign to be set - siteName
 - Type: SystemString
Name of the site the campaignCode belongs to - source (Optional)
 - Type: SystemString
Name of the campaign source - content (Optional)
 - Type: SystemString
Campaign UTM content 
Implements
ICampaignServiceSetCampaign(String, String, String, String)
Exceptions| Exception | Condition | 
|---|
| ArgumentException | campaignCode is null -or- siteName is null or empty | 
Examples
            Following example shows how to use the 
SetCampaign(String, String, String, String) method.
            
var campaignService = new CampaignService();
...
campaignService.SetCampaign("myCampaign", "mySite", "mySource", "myContent");
...
public string GetCampaignCode() 
{
    return campaignService.CampaignCode;
}
public string GetSourceName() 
{
    return campaignService.CampaignSourceName;
}
public string GetCampaignContent() 
{
    return campaignService.CampaignSourceName;
}
See Also