Actually, this is almost the same as how to store Adsense ads in the post manually, it's just that here we don't store the ad code directly in the post, but we only store the caller code.
So with this, we can easily replace ad units or replace ads with other accounts without having to edit posts one by one. We only need to replace the ad code in HTML editing only.
Actually, in Google, there have been many articles discussing how to save Adsense ads in posts automatically, but there are some bloggers who feel uncomfortable in this way because the placement of ads in posts is out of our control in full.
For that, you can try this trick, so that the ad will appear according to our will.
Please change the code that I mark with a code like that from your Adsense ad code. Pay attention to each quotation mark from the ad code with a single quote instead of double quotation.
Then please use this code to call ads, please save in the post as you wish in HTML posting mode.
If you want to save other ads, please create the code above with a different caller ID. You can use the following code for the second ad.
And use this code to call a second ad, please save it in the post as you wish in HTML posting mode.