Reputation: 13
I have a question about triggering profiles associated with an item. If a visitor visits a page, the profiles associated with that page are triggered for that visitor.
How can I trigger the profiles associated with an item in code? The item is not a page. I only want to trigger the profiles if a visitor matches some kind of conidtion.
Thank you!
Upvotes: 1
Views: 283
Reputation: 6890
This is all done through the startTracking
pipeline. Unfortunately, it looks as if Sitecore has "hard coded" the pipeline to use the Context Item. You should be able to accomplish this though by replacing the ProcessItem
processor.
Note: The following is untested.
Sitecore.Analytics.Pipelines.StartTracking.StartTrackingArgs
which has an Item
propertySitecore.Analytics.Pipelines.StartTracking.ProcessItem
. Use reflector or ILSpy to pull the existing logic of the Process
method. If the StartTrackingArgs
passed in are of your subclass, and an Item
property is specified, use it instead of the context item.ProcessItem
in the startTracking
pipeline using an Include config with a patch:attribute.StartTrackingArgs
and call Sitecore.Analytics.Pipelines.StartTracking.StartTrackingPipeline.Run(yourArgs)
.Upvotes: 2