Post

2 followers Follow
0
Avatar

Can I use a custom field to embed HTML on a Landing Page?

Frank Hagan

I want to embed a unique YouTube video for each contact by putting the HTML embed code into a custom field in their Contact Record, then using that field as a merge field on a PURL Landing Page. Will that work? How do I do that?

Answered

Official comment

Avatar
  1. Create a Custom Field in the contact record for the unique YouTube URL. We recommend using a "Long Text" field for this.
  2. Upload a video to YouTube
  3. Click the Share button underneath the video
  4. Click the Embed button
  5. Copy the YouTube embed code to the clipboard
  6. Create a new Landing Page in ONTRAPORT
  7. For ONTRApages, use a Video block and paste the YouTube embed code into the "Embedded" tab.

    For Legacy Landing Pages, add an Html layer and paste the YouTube embed code into the html layer.

  8. Replace the last part of the YouTube URL (the YouTube video ID - shown as "dtCUYUBOnzk" below) within the embed code with the merge field for the unique YouTube URL from step 1
    Example: 

    <iframe width="560" height="315" src="http://www.youtube.com/embed/dtCUYUBOnzk" frameborder="0" allowfullscreen></iframe>

    Becomes:

    <iframe width="560" height="315" src="http://www.youtube.com/embed/**[Your Merge Field Here]**" frameborder="0" allowfullscreen></iframe>
  9. Note that the video will not load in the ONTRApages editor; the page must be published and then visited as a URL for the video to play. Save the block (or in a Legacy Landing Page, save the page). 
  10. Manually add the YouTube video ID - shown as "dtCUYUBOnzk" in the example above - to the Contact Record in the custom long text field created in step 1.
  11. For testing, create a Contact Record and fill the custom long text field, then send an email with the PURL URL (it is found in the merge field drop down within the email editor). 

The disadvantage of this system is that the page will only show the video if there's an entry in the individual Contact Record field. To have the page display a default video if the field is empty, visit Contacts > Settings > Default Merge Fields and add a default YouTube video ID for the field. 

Frank Hagan

Please sign in to leave a comment.

2 comments