Expand my Community achievements bar.

SOLVED

Custom Context Store

Avatar

Former Community Member

Hi,

     I have a requirement of showing 3 personalised content(images) based on visitor information:

  1. unknown visitor: When visitor first visit the website
  2. identified visitor: When same visitor visit the website again(by tracking IP/cookie)
  3. Logged-in user

Could some one please help to identify the best approach for the above requirement ? does it require to implement custom context store ? how we can achieve this ?

already went through the document Creating a Session Store code snippet but dont know exactly where to put that code.

Any guidance on above will be really helpful.

 

regards,

Nitin

1 Accepted Solution

Avatar

Correct answer by
Level 10

Nitin.dev wrote...

Hi,

     I have a requirement of showing 3 personalised content(images) based on visitor information:

  1. unknown visitor: When visitor first visit the website
  2. identified visitor: When same visitor visit the website again(by tracking IP/cookie)
  3. Logged-in user

Could some one please help to identify the best approach for the above requirement ? does it require to implement custom context store ? how we can achieve this ?

already went through the document Creating a Session Store code snippet but dont know exactly where to put that code.

Any guidance on above will be really helpful.

 

regards,

Nitin

 

Your business case can be easily achieved using content targetting & is meant for such use case.
 http://dev.day.com/docs/en/cq/current/wcm/content-targeting.html

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Nitin.dev wrote...

Hi,

     I have a requirement of showing 3 personalised content(images) based on visitor information:

  1. unknown visitor: When visitor first visit the website
  2. identified visitor: When same visitor visit the website again(by tracking IP/cookie)
  3. Logged-in user

Could some one please help to identify the best approach for the above requirement ? does it require to implement custom context store ? how we can achieve this ?

already went through the document Creating a Session Store code snippet but dont know exactly where to put that code.

Any guidance on above will be really helpful.

 

regards,

Nitin

 

Your business case can be easily achieved using content targetting & is meant for such use case.
 http://dev.day.com/docs/en/cq/current/wcm/content-targeting.html

Avatar

Level 8

As indicated in the doc page  that you linked to, the code can go in the client library that you create:

"Create a client library folder that has a categories property value of personalization.stores.kernel. Client Context automatically loads the client libraries of this category."

"Including the javascript in the personalization.stores.kernel client library causes the store to be created when the Client Context framework is loaded."

hope that helps,

scott

Avatar

Former Community Member

Thanks scott, I am able to create custom store by inheriting genericstoreproperties and adding my custom store in init.js.jsp. I would like to know Is there any default client context api to create a cookie for tracking the visitor info whether he is visiting for the first time or not ? or there is any other way to find this out. any direction on this will be really helpful to achieve my above explained point 1 & 2.

regards,

Nitin