CampaignServiceSetCampaign Method |
If
CampaignInfo with given
campaignCode exists and is running, sets both
campaignCode and
source to their
properties (
CampaignCode or
CampaignSourceName respectively).
Additionally performs logging of campaign hit to the analytics.
Namespace: CMS.WebAnalyticsAssembly: CMS.WebAnalytics (in CMS.WebAnalytics.dll) Version: 9.0.0
Syntax Exceptions Exception | Condition |
---|
ArgumentException | campaignCode is null -or- siteName is null or empty |
Remarks
If Javascript logging is enabled, hit logging will be performed asynchronously on the following request.
Examples
Following example shows how to use the
SetCampaign(String, String, String) method.
var campaignService = new CampaignService();
...
campaignService.SetCampaign("myCampaign", "mySite", "mySource");
...
public string GetCampaignCode()
{
return campaignService.CampaignCode;
}
public string GetSourceName()
{
return campaignService.CampaignSourceName;
}
See Also