Using the Email Validation API with Google Tag Manager in Your Forms
SafetyMails’ Email Validation API allows you to create a code for installation in your forms using Google Tag Manager, preventing the entry of invalid email leads into your database.
By activating this functionality, SafetyMails will generate a ready-to-install code for the Email Validation API on your Landing Pages or website.
Creating a Source:
Remember that for this real-time Email Validation API to work, you need to have an activated credit subscription (see how to subscribe).
To start the process, follow these steps:
- Access your account on SafetyMails (If you don’t have an account, create one now and get 100 free credits).
- In the top menu, click on “Real-time API.”
- Select the “Standard Installation” option.
- On the next screen, give a name to the source you are creating;
- Register the domain of your form (for example, if your form is at “https://safetymails.com/form,” you should enter only “safetymails.com”);
- After that, select the option “On a platform” from the list of options where you intend to use your Email Validation API.
- Select the Google Tag Manager platform.
- On the screen that will be displayed, you can configure the permissions for your API for forms, namely:
- Allowed statuses: define which API response statuses will allow registration in the form.
- Block provider domains: enabling this function will prevent the registration of emails with provider domains, such as Gmail.com, Yahoo.com, among others.
- By clicking “Finish,” the installation script of the API will be created and available for use.
- The details of the created API will be described on this page.
Example of Code:
<script src=’https://optin.safetymails.com/main/safetyscript/28a389f6fd52************29fd837e8ee8c280/safetyoptin.js’></script>
In the Google Tag Manager Panel:
- In Google Tag Manager, go to “Triggers >> New.”
- Then, under “trigger type,” select “Page Loaded.” Save.
- Next, go to “Tags >> New.”
- In “Configuration,” select “Custom HTML.”
- Paste the script generated by SafetyMails into the “HTML” field.
- In the “Triggering” field, select “All Pages”.
- Save the process, and the API should work correctly.
If you have any questions, don’t hesitate to reach out to our support team. Contact us via email at [email protected].