As per the guidelines provided in below link, I have implemented the same way. However I am not seeing the variables & events in image beacon. I have AppMeasurement version 1.4.4. Please help me here.
I was not referring the function properly so code was not executing. Now its working as expected.
Please close this query.