How to call or import code blocks from Tracking Tools & Analytics , Custom code part ?

Successfully added codes , in custom tool , in Tracking tools & Analytics .
How to call that function , I am trying this one , not getting any responses ,
import wixWindow from ‘wix-window’;

wixWindow . trackEvent (“CustomEvent”);
Is there any way how to call or import that code , on page or etc . Can you give any sample by clicking button or any , result is reflecting from that custom section ?
Looking help from you .
Thanks .