Directivity vs. Gain;
When you integrate antenna patterns, you are calculating "Directivity".
"Directivity" is not the same as "Gain". Gain includes losses. Directivity justs shows you how focused the beam pattern is, i.e. the shape of the antenna pattern.
To arrive at the peak "Gain" value of the antenna you need to measure/calculate/estimate the antenna losses, such as VSWR loss, power divider loss, and loss due to crosspole components from the antenna. Or, since that's such a headache to get good accuracy, it's most common to a known good gain standard to reference your measurements, (horns and dipoles primarily.
Check your result compared to this approximate formula.
Directivity = 41,000/(Azimuth beamwidth x Elevation beamwidth), - beamwidths in degrees.
To estimate the gain, often 34,000/AZ*EL beamwidths is used.
One note of caution I've learned the hardware using this simple formula, it can be inaccurate;
While measuring a 6-18 ghz ridged horn antenna for beam patterns and gain, I compared it to an accurate gain standard horn.
I had 4 dB lower measured gain when using an accurate horn antenna gain standard than I expected when I compared the gain to calcuated using the above simple formula 34,000/Az*El beamwidths. i.e it was way way off, and below spec. The VSWR was good, so I was puzzled.
An odd mode was generated in the antenna resulting in the antenna pattern being weaker at boresight and stronger in the intercardinal planes, or the corners top left, top right, bottom left, bottom right and boresight became the weak point. Since I used the E and H plane antenna beamwidths instead of the intercardinal plane beamwidths, that was my error.
The horror, it took a month to fix the problem.
kch