Expand my Community achievements bar.

Join us for an upcoming in-person Adobe Target Skill Builders event ~~> We're hosting these live learning opportunities to equip you with the knowledge and skills to leverage Target successfully. Learn more to see if we'll be coming to a city near you!
SOLVED

Getting a error when using a css selector

Avatar

Level 1

Within Target Goals and Settings I am trying to select multiple elements with the same class CSS selector and I get an error:
ERROR The element selector entered maps to multiple locations on the page. Not sure why this is an issue?

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi @nimay50244411 ,

Having multiple elements share a selector is typically not good practice, especially when using the VEC. This could cause issues during content delivery and or tracking goals and settings. 

For instance, if you want to change a heading for element A using the VEC and track clicks on element B when both elements share the same CSS selector: Target will not know how to differentiate between the two elements. This is why we recommend using unique IDs for elements that you would like to test or target using Target. See this article for more information.

Let me know if you have any questions!

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

Hi @nimay50244411 ,

Having multiple elements share a selector is typically not good practice, especially when using the VEC. This could cause issues during content delivery and or tracking goals and settings. 

For instance, if you want to change a heading for element A using the VEC and track clicks on element B when both elements share the same CSS selector: Target will not know how to differentiate between the two elements. This is why we recommend using unique IDs for elements that you would like to test or target using Target. See this article for more information.

Let me know if you have any questions!

Avatar

Employee

@nimay50244411 I understand that you are trying to select multiple elements with the same class CSS selector for click tracking.

I would like to confirm that currently, Target VEC does not allow for multiple elements with the same selector to be selected for click tracking.

However, this is already raised as a feature request and this feature is slated to be released in the upcoming releases of Target which would add support in the VEC to allow click tracking on a css selector that matches more than one element in the page.

https://docs.adobe.com/content/help/en/target/using/release-notes/target-release-notes.html

 

Let me know if this helps.

 

Regards,

Karan