How to associate a WordPress heartbeat with an ajax form

I have a form that $ _POSTs an input value and a user identifier that records the data in the database:

// front form 
// footer script // validation extract

When users set the location of the radio from their desktop, it sends the form to the server and saves it.

Each user also has a screen (tablet) that does not have contribution but echoes the location value.

I currently have the refreshing tablet every 5 minutes, but I wanted it to be more of a boost with WP's heartbeat.

I've tried using this example: https://gist.github.com/strangerstudios/5888123

But I did not know how to have the value of the The data['client'] = & # 39; marco & # 39 ;; be The data['client'] = & # 39;& # 39 ;; whenever it is printed once and not updated once the page loaded or location changed.