Can I create a rule with a "does not contain" CSS selector?

I'm having trouble tagging a specific element in my app.  Here is the scenario:

  • my application is SPA, so the URL/page in this example never changes
  • the specific element I want can appear on the page in two different places, Location A and Location B (depending on context)
  • only want to tag clicks of the element in Location B (and not Location A)
  • in both places, the element ID is the same and it has the same classes and attributes
  • the only difference I can find is that when displayed in Location A, the element is part of a parent div that has the class ".k-upload-empty"
  • when displayed in Location B, the parent div simply doesn't have this class


I'm trying to find a way to write a rule that only clicks in Location B are tracked, but I feel like I need some "does not contain" capability since the only unique difference I can find between the two is the presence/absence of the ".k-upload-empty" class.   

Can you help me?



  • Hi Martin Armstrong

    You might be able to use nested elements for this. The rule for Location A would be something like .k-upload-empty #elementId (replacing element ID with the real ID of the element). For Location B you would not be able to use just DIV #elementId because that would match the original one - but if there is a div or element above that level with a class in it you could use that class instead. 

    If that isn't an option (and there are no classes above the DIV you referenced I think you would need to have developers on your side add unique IDs to the buttons to make it work. 

    If the buttons are on different pages of the app (but the pages just don't have different URLs because it is a SPA) you may want to look into our Location API  to see if that would help you to give those pages separate URLs in Pendo and allow you to tag things more easily. 

  • Thank you for the helpful response, Todd-Stoffer.  I'm thinking I may need to have developers add unique IDs here as all the higher level elements look the same in Locations A and B.


Please sign in to leave a comment.

Didn't find what you were looking for?

New post