Google Analytics how to track the transition from an external link?

There is a hotel website on wordpress, it has an external link to booking on a different source from the menu Reservation
Need to track the clicks using Google Analytics

1)tried the Google Analytics Category: links Action:click Label:wubook
in scripts

$("a[href='https://wubook.net/wbkd/wbk/?lcode=1398667176']").attr(
"onClick",
"ga('send','event','outbound','click');"
);

get menu, type Reservation

does not work

2) documentation for the Google Analytics Category: outbound Action:click

script: $("a[href='https://wubook.net/wbkd/wbk/?lcode=1398667176']").attr
("trackoutboundlink","('https://wubook.net/wbkd/wbk/?lcode=1398667176'); return false;");

menu: Booking

not working
Where is the error? how to set correctly?
June 7th 19 at 14:42
1 answer
June 7th 19 at 14:44
Chrome + F12

networking + JS debugging

Find more questions by tags Google AnalyticsWordPress