Your question is google-adsense tagged, so the first what you will probably want to try are "AdSense Experiments". https://support.google.com/adsense/answer/4599562?hl=en
Here are some examples of the types of experiments that you can run:
- Compare the performance of text-only ad units to ad units that have
both text and display enabled
- Analyze the effect of changing the color
of ad text on ad performance
- Determine the impact on your revenue of
using ad serving, sensitive and/or general category blocks
You will probably notice you can't test different fixed ad sizes with AdSense Experiments feature. I'm not 101% sure, and I think that is because AdSense is already optimizing them with "Similar-sized display ads". https://support.google.com/adsense/answer/3234887?hl=en
But you can see which sizes are better performing on that slot, in your perfomance reports: on "Ad units" page click on ad unit name, and then switch "Days" dimension to "Creative sizes". https://support.google.com/adsense/answer/2546700?hl=en
Also, there is "A/B testing" listed as acceptable on "Modification of the AdSense ad code" page:
https://support.google.com/adsense/answer/1354736?hl=en
And you can connect AdSense account with Analytics:
https://support.google.com/adsense/answer/98155?hl=en
(It is completely non-related to your question, but just because we are talking about experiments with AdSense ads, it may be worth to mention and to keep in mind: if you create width: X; height: Y;
ad unit, but you need M*N
for experiment, then you can't just manually change ad code to width: M; height: N;
and you will need to create new M*N
ad unit.)