Retaking math course during summer to boost GPA?

What are your opinions regarding taking an online course during the summer to replace a lower grade and boost your GPA on your transcript?
I am currently a junior, and I have received 4 B’s in high school so far-- Geometry H my freshman year, and Algebra II H my sophomore year (all 4 semesters). As you can tell, math is not my strongest subject; however, I am doing quite well in Pre-Calculus AB this year, so it is more likely for me to receive an A this year.
I am considering taking both Geometry H and Algebra II H online this summer in hopes of receiving A’s, even if I receive credit just for one semester each. I know that B’s are not too bad especially in the earlier years of high school. But, I feel as if I should at least make an attempt to retake the course since I already have the option to potentially replace these with a higher grade.
Are there any cons to retaking these courses?

Hate to break it to you, but I don’t believe online courses count towards your GPA. Most people take them just to not have to take them in high school or because it is not offered (AP Calculus BC). I would see your guidance counselor to get more information on this.

Besides, if colleges see you struggle in a certain subject, but then succeed, it demonstrates that you are putting more effort into the class and know what you are doing. Pretty sure colleges wouldn’t think a tiny bit negatively about a person who had a B in Honors Geometry if they got an A in AP Calculus AB/BC.

Hate to break it to you, but I don’t believe online courses count towards your GPA. Most people take them just to not have to take them in high school or because it is not offered (AP Calculus BC). I would see your guidance counselor to get more information on this.

Besides, if colleges see you struggle in a certain subject, but then succeed, it demonstrates that you are putting more effort into the class and know what you are doing. Pretty sure colleges wouldn’t think a tiny bit negatively about a person who had a B in Honors Geometry if they got an A in AP Calculus AB/BC.

From what I have heard, my school’s online summer courses offer up to one semester of credit, and you may retake a course to receive a higher grade.
That’s true, an upwards trend is always something that colleges like to see.