Added Users analytics support

I have created a new function to add people insights tracking, and refactored a bit the code to avoid repeating code inside all the functions.