Before you can contact customers on their birthdays or anniversaries, you need to collect their birthday or anniversary dates. Send subscribers an email linking them to an Onsite form (already pre-filled with their email addresses), where they can add their special date!
Prefill the Email Field with the use of SiteData
To start this process, understand that you will be utilizing SiteData. Think of SiteData as a bucket you can add data to for use in your Onsite Pop-ups.
In summary, you will:
- Dynamically add the subscriber’s email address to a redirect link as a UTM parameter
- Use a coding script to take the email address from the URL and add it to SiteData’s bucket
- Use a SiteData Merge Tag to pre-load the email field with the email address provided to SiteData’s bucket.
Add Script to Your Site
To send your subscribers' email to SiteData, you’ll need to set up your site with custom code that we’ll provide below. This code identifies the email address provided in the utm parameters and gives that email to SiteData for the Onsite Pop-up to use in the email field.
- Set up your site with the following Script:
<script>
try {
window['DripOnsite.sitedata'] || (window['DripOnsite.sitedata'] = []);
var urlSearch = new URLSearchParams(window.location.search);
if(urlSearch.has("email"))
window['DripOnsite.sitedata'].push({'email': urlSearch.get("email")});
if(urlSearch.has("first_name"))
window['DripOnsite.sitedata'].push({'first_name': urlSearch.get("first_name")});
}
catch(err){
}
</script>Set up an Onsite Pop-up with SiteData merge tag
- Under the Design tab in the Onsite Builder, click on the “email” field to edit the Email Input settings.
- Under Change Value Attribute, add the SiteData merge tag:
{{SiteData:email}}
- Navigate to the Field Mapping tab to ensure the Date Input Field maps to the correct “birthday” field
- Map your date field to the correct custom field, “birthday”
Set up your Email with a Link to the Onsite Pop-up
Now that your website and Onsite Pop-up are ready, you can set up your form with the UTM-enabled link to give SiteData your subscriber’s email address.
The UTM parameter will dynamically pull the subscriber’s email address by calling a custom field via Liquid through {{subscriber.email}}.
Once you’ve built out your form:
- Set up your hyperlink or button with a link to the Onsite Pop-ups on your site.
- Make sure to append the following UTM parameter to dynamically pull the person’s email address:
-
?email={{subscriber.email}}- ex:
www.drip.com?email={{subscriber.email}}
- ex:
-
- Make sure to append the following UTM parameter to dynamically pull the person’s email address:
Install our Birthday/Anniversary/Milestone Workflow
Now that you've collected that special date, install our Birthday/Anniversary Workflow below, or build your own. Our pre-built Workflow has a Trigger already defined to work with your e-commerce platform and include recommended Action and Delay steps.