Strange error

Keep on having the error : cannot connect to internet when trying to get the free weapon from the shop then when i close the automatic 5secs advert pops out. If i really cant connect to the internet why the automatic ad got displayed?