2

I'm running sitecore 7.2.

A sublayout is shown and there will be a button on it to go to the detail. If the visitor does not click on the button if he sees the sublayout for X-times the sublayout should be changed to something else.

I was thinking on creating a cookie on the sublayout to count the times the sublayout has loaded on the page for that user. and if a custom rule to check the value of that cookie if it is equal or greater than a value.

but i'm not sure if this is the correct way. as it seems to do too much custom work for simple personalization...

1
1

First, it is not OOTB. There can be different approaches. You can use the cookie based approach or the Rule Engine approach. Below is the a theoretical approach using the Rule Engine and Sitecore Goals

Goals

The use of goals allow you to track down whether the user has clicked on the button. So, you need to create your goals in the sitecore path /sitecore/System/Marketing Center/Goals. Once the user clicked on the button, you trigger the Goal programmatically using the VisitorManager class.

Tracking

If the user has not click on the button and is navigating throughout the site, you need to keep track on the number of times the sublayout is being loaded. You can achieve this using the Tracker.Visitor.Tags. This will be per User. Each time the user loads the page where the sublayout is present, increment the Tracker.Visitor.Tags

Rule Engine

To change the sublayout, Sitecore has already an in-built action which is the set the datasource to Item. So by making use of the value obtained in the tags of the visitor, you may define a ruleset as below:

Conditions

except where the 'specific' tag of the visitor 'compares to' 'value'
and where visitor 'specific' tag value 'compares to' 'number'

Actions

set data source to 'Item'

You may need to define the 2nd statement in the conditions as follows:

where visitor [TagName,,,specific] tag value [operatorid,Operator,,compares to] [Value,,,number]

Here is a link which can help you in coding the Rule Engine:

https://jeffdarchuk.com/2015/06/04/lets-use-that-rules-engine/

So, to conclude, the simplest approach is to make use of the cookie based one as using the Rule Engine will require that the indexing is working properly and also require major code implementation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.