Skip to content

Instantly share code, notes, and snippets.

@lowedown
Created July 11, 2014 07:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lowedown/8f78d575c2d7fee45ed0 to your computer and use it in GitHub Desktop.
Save lowedown/8f78d575c2d7fee45ed0 to your computer and use it in GitHub Desktop.
Hook for the triggerCampaign pipeline to always associate a campaign to a visit.
public class AssociateCampaignToVisit : TriggerCampaignProcessor
{
public override void Process(TriggerCampaignArgs args)
{
Assert.ArgumentNotNull((object)args, "args");
// Always associate the campaign to the current visit when triggered
Sitecore.Analytics.Tracker.CurrentVisit.CampaignId = args.Definition.ID.ToGuid();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment