add global tag function and event cleaning sequence for data

add global tag function and event cleaning sequence for data