Expand my Community achievements bar.

Using Text Transformer and personalization together.

Avatar

Level 2

Hello all!

 

Currently we have developed a custom TextTransformer that replaces some constants in the html. 

 

We have noticed that this transformer is not working when personalization is applied to the page and it's loading a variation (The master variation is working ok) We are using context hub for personalization.

 

 

Any hint how to solve this? Thank you.

8 Replies

Avatar

Employee

Context hub is Java Script API implementation where TextTransformer runs on server side. when TextTransformer runs after that only Personalization takes place and that is why you are not seeing the changes. check if you have given the path for Transformer configuration.

Avatar

Level 2

Hello, i have "/content" path under the rewriter configuration xml file: 

 paths="[/content]"



Avatar

Employee

It might be the case that your transformer is HTML parser but the context hub is calling json data for the experience. can you please check the browser call and verify this ? 

Avatar

Level 2

It's HTML parser, yes. And i think you are right about context-hub, coming form json. 
is this 

    contentTypes="[text/html,application/json]"

enough or do I need a different 

    generatorType="htmlparser"

 

Avatar

Level 3

Can you give an example of what is not working? Are you changing text in default teaser/xf using TextTransformer and is it based on outcome of user params/ contexthub resolution?

Avatar

Level 2

E.G: A text that is in HTML something like $[test] is transformed into a constant String from my Transformer. 
But when personalization is happening (in this example, when astorage value is set), a variation that is not Master is rendered, and the Transformer not applied, so we see $[test] in the final rendered Html