Add event tracking code