advertisment sending function client side
merge advertistment sending funtion client side and server side