If you are running your sites on WordPress, you can use Optingun plugin, which will help you adding forms to your sites with a click.
You can watch this video or continue reading to know how to use Optingun Plugin with your WordPress site
Login to your WordPress admin and go to plugins page.
Search for "Optingun" and the Official Plugin will get listed. Or you can download the plugin directly from WordPress plugin library
Install and Activate that Plugin, and you will see Optingun menu in the left Admin Menu.
Go to Optingun page by clicking menu item on left menu, and there you will need to save your Optingun API Key.
To know your API key, you can go to Optingun dashboard and go to API settings page, or, from your WordPress admin Optingun page, click on "Get your API Key"
Copy the Key and save it in the field, after saving it you will see all your forms listed under that. with each form there will be action buttons, either to Add a Form, or to Remove a Form.
Add the forms that you want to add, only the forms you added will appear on your WordPress site pages.
All done, when you add new forms on Optingun site, those will appear on your WordPress page automatically.
You dont need to make any code changes to your site if you just use this plugin.
Optingun Help - Adding Optingun to your WordPress Site