Using pixel code to track an element

Hi I am trying to use facebook pixel code to track an actual button click in my menu header. I have been told that you can only add code to the page but not to an element that is part of the header. Is this true? Has any else experienced this problem as well and found a workaround?

The button in the menu bar is an external link FYI.