Is there a way to automatically add visitors to a specific site definition to a specific engagement plan OOTB?
Is there a way this could be implemented programmatically?
Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up.
Sign up to join this communityIs there a way to automatically add visitors to a specific site definition to a specific engagement plan OOTB?
Is there a way this could be implemented programmatically?
To add a user to an engagement plan (EP) with code is very simple. You just need to new up an AutomationStateManager and enroll the user in the EP. Just supply the ID of the EP.
var a = AutomationStateManager.Create(Tracker.Current.Contact);
a.EnrollInEngagementPlan([ID of the EngagementPlan], IDs.EngagementPlans.State.BeginingState);
AutomationStateManager
in? And what version of Sitecore is this in relation to?
– Dylan Young
Sep 19 '17 at 15:37
You can do that in couple of ways:
1. Using the WFFM Module save action.
You can find more info on the official documentation link
2. Using the campaign trigger
This is a way of achieving what you need without additional modules, but a bit hacky.
Create a campaign and associate it with the desired plan. documentation link
Add the script to your page: <script type="text/javascript">$(function() { $.get('/?sc_camp=[campaignid]'); });</script>
. Alternatively, you can add this query string element ?sc_camp=[campaignid]
to the required page.