Machine learning has significantly disrupted various sectors, and marketing is no exception. Marketers now have the ability to analyze extensive datasets, yielding comprehensible insights and results that can be strategically leveraged. A multitude of machine learning libraries and APIs are readily available, empowering marketers to enhance their digital analytics and improve marketing outcomes.

Machine Learning APIs simplify the development of predictive applications by offering potent pre-trained models through REST services. Today, I’ll delve into a classification ML API known as Namsor.

The Namsor API excels at accurately classifying personal names based on gender, country of origin, or ethnicity. Predicting gender and ethnicity holds numerous applications in marketing, such as audience targeting, lead qualification, and more. In this demonstration, I’ll showcase how to use Google Tag Manager (GTM) to extract the “Full Name” from the “Contact Us” form on my blog and predict the gender of users who reach out for email personalization and enhanced communication.

1. Capture Full Name from the Form in GTM: The initial step involves capturing the name from the form as a variable in GTM. While the detailed steps for this process are not covered here, ensure you have a variable that captures the user’s name upon form submission.

2. Call the Namsor API: The subsequent action is to call the Namsor API and pass the full name for gender prediction. Create a Custom HTML tag in Google Tag Manager and insert the provided code. Remember to replace the API key with your Namsor API key, obtained upon sign-up.

Create a new trigger to fire the Namsor tag when {{form_fullname}} isn’t undefined. Your tag configuration should resemble the provided example.

Additionally, establish a Datalayer variable named “likelyGender” to capture the predicted gender from the Namsor API.

With these steps completed, you are now ready to test the API. Upon submitting a form with a name like ‘Steve Harvey,’ the API predicts the likely gender as Male. Now, you have a GTM variable that can be seamlessly integrated with Google Analytics, Email Marketing platforms, or any other tool in your marketing arsenal.

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.