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.