You can try placing id or class of button which is not visible to select, in modifications as shown in the following screenshot while selecting an element (element should be present in HTML. Target tracks click using id or class of element. id would be more ideal since it's unique for all elements)
Let me know if this helps
Can you clarify one thing? if your container is hidden no one will be able to click on it and there is no point in tracking click of a hidden container/button.