Adobe Target VEC Selectors | Community
Skip to main content
February 11, 2025
Solved

Adobe Target VEC Selectors

  • February 11, 2025
  • 2 replies
  • 898 views

Hi All, 

We are building an integration for our SPA websites with Target Visual Experience Composer. One thing I wanted to check if the CSS Selectors in VEC. In documentation, its mentioned that we can only use either ID, or CSS class or a default selector based on "Compose" option - https://experienceleague.adobe.com/en/docs/target/using/administer/visual-experience-composer-set-up

 

Is there an option to use custom data attribute, for example : data-cy= "button-tv-box"

 



Has someone used custom attribute for selector? 

 

Thank you in advance for your feedback

Best,

Rupal

 

Best answer by RajeshManoharan

Hi @rupalja ,

 

Once you pick the element on VEC editor, it will prompt selector value by default on the CSS element selector, There you can edit by adding data attribute and value like below,

Hope this helps !

2 replies

RiteshY18
Community Advisor
Community Advisor
February 11, 2025

@rupalja  as a workaround you can have data attribute specific class and apply to DOM element where you are planning to use data-cy and within that class if apply attribute specific CSS selector to make it unique class 

RupalJaAuthor
February 12, 2025

Hi @riteshy18 ,

Thank you for your response and the idea. At the moment, this is not possible since the development teams cannot change add the class right now. Hence, I was thinking is its possible to use data attributes. 

 

Best,

Rupal

RiteshY18
Community Advisor
Community Advisor
February 13, 2025

@rupalja in either case you have to apply CSS, so may be use VEC and apply required CSS  as inline CSS  to data attributes - this you can do without having dev/IT support 

RajeshManoharanAccepted solution
February 18, 2025

Hi @rupalja ,

 

Once you pick the element on VEC editor, it will prompt selector value by default on the CSS element selector, There you can edit by adding data attribute and value like below,

Hope this helps !

RupalJaAuthor
February 19, 2025

Thanks @rajeshmanoharan , I checked it quickly and it worked. I will check more scenarios further.