Each platform will have a specific way of collecting data and using that data. Make sure to set goals and benchmarks prior to the campaign.
Different options to optimize campaign can range from changing content of creative, times of day serving ad, ad format, and more.
Google analytics allow you to collect data about your consumer which can by highly productive. The better your know your consumer the better you can make decisions about your business.