Add Onclick event to previous_post_link function

I’m trying to add a Onclick event to the previous_post_link function

This is what I have

This is what I’ve tried

I added the variable $tracking

And I tried to add him this way without success:

What am’I doing wrong?