{
  "Status": true,
  "Message": "",
  "Response": {
    "post": {
      "postuid": "9a698315-2e08-4b3b-8052-ecbb6371c13b",
      "tenantuid": "d8b744fc-2e70-4089-bb80-dd1d08f6c7b2",
      "projectuid": "239698c5-f7eb-4574-8cc8-c6568f08b3a0",
      "title": "How to use on-demand webinars as a lead magnet",
      "slug": "article/how-to-use-on-demand-webinars-as-a-lead-magnet",
      "html": "\u003Cp\u003EAt DailyStory we try to \u003Ca href=\u0022https://www.dailystory.com/webinar/\u0022\u003Ehost a free webinar\u003C/a\u003E at least once a month. And, we always record the webinar and host in on our website so it can be viewed again. But more importantly - we use it to attract potential customers!\n\nThe purpose of this tutorial is to walk-through the technical steps for how we generate leads from on-demand webinars through the use of \u003Ca href=\u0022https://www.dailystory.com/features/web-forms/\u0022\u003Eweb forms\u003C/a\u003E\u0026nbsp;and \u003Ca href=\u0022https://www.dailystory.com/integrations/wordpress/\u0022\u003EWordPress integration\u003C/a\u003E.\n\nThis tutorial can be used for any type of lead magnet on your website, in our example we\u0027re using a webinar.\u003C/p\u003E\u003Cp\u003E\u003Ccite class=\u0022warning\u0022\u003E\u003Cspan class=\u0022title\u0022\u003EWarning\u003C/span\u003E\u003Cp\u003EIt\u0027s important to mention that the technique demonstrated in this tutorial is not meant to be secure. Rather to create enough friction that submitting the form is easier than working around the form.\u003C/p\u003E\u003C/cite\u003E\u003C/p\u003E\u003Ch2 id=\u0022what_you_will_need_to_follow_along_in_this_tutorial\u0022\u003EWhat you will need to follow along in this tutorial\u003C/h2\u003E\u003Cp\u003ETo follow this tutorial step-by-step you\u0027ll need the following:\u003C/p\u003E\u003Cul\u003E\u003Cli\u003E\u003Ca href=\u0022https://app.dailystory.com/free\u0022\u003E\u003Cb\u003EDailyStory account\u003C/b\u003E\u003C/a\u003E - you can start for free.\u003C/li\u003E\u003Cli\u003E\u003Cb\u003EWordPress\u003C/b\u003E - any WordPress site will work.\u003C/li\u003E\u003Cli\u003E\u003Cb\u003E\u003Ca href=\u0022https://wordpress.org/plugins/dailystory/\u0022\u003EDailyStory WordPress plugin\u003C/a\u003E\u003C/b\u003E - this makes using DailyStory in WordPress easier.\u003C/li\u003E\u003C/ul\u003E\u003Cp\u003EYou\u0027ll also need some familiarity with JavaScript and feel comfortable editing WordPress php template files.\u003C/p\u003E\u003Ch2 id=\u0022create_a_landing_page_and_form_page_in_wordpress\u0022\u003ECreate a Landing Page and Form Page in WordPress\u003C/h2\u003E\u003Cp\u003EThe first step is to create two pages in WordPress:\u003C/p\u003E\u003Cul\u003E\u003Cli\u003E\u003Cb\u003ELead Magnet Landing Page\u003C/b\u003E - this is the landing page where the lead magnet resides, such as a hosted webinar\u003C/li\u003E\u003Cli\u003E\u003Cb\u003ELead Magnet Form Page\u003C/b\u003E - this is the page that hosts the form that must be submitted to access the landing page.\u003C/li\u003E\u003C/ul\u003E\u003Ch2 id=\u0022lead_magnet_landing_page\u0022\u003ELead Magnet Landing Page\u003C/h2\u003E\u003Cp\u003EBelow is a screen shot from our \u003Ca href=\u0022https://www.dailystory.com/webinars/email-marketing-best-practices/\u0022\u003EEmail Marketing Best Practices webinar\u003C/a\u003E. We publish our webinar recordings on Vimeo and then use Vimeo embed tags to host the video player.\u003C/p\u003E\u003Cp\u003EThere are two things we need to add to this page.\u003C/p\u003E\u003Ch3 id=\u0022add_a_custom_field_in_the_wordpress_page\u0022\u003EAdd a custom field in the WordPress page\u003C/h3\u003E\u003Cp\u003EThe first is a custom field in WordPress. You can find this option when editing a page in WordPress, just scroll down to the bottom.\n\nThe name of the custom field doesn\u0027t matter, but the value of the custom field needs to be the URL to your lead magnet form page. We\u0027ll need this value to redirect visitors to the lead magnet form page if they haven\u0027t submitted the form.\n\nIn our case this value is: https://www.dailystory.com/webinars/email-marketing-best-practices/\u003C/p\u003E\u003Ch3 id=\u0022modify_the_php_and_add_some_javascript\u0022\u003EModify the PHP and add some JavaScript\u003C/h3\u003E\u003Cp\u003ENext, we need to add some PHP code and some JavaScript. In this case you\u0027ll need to modify the PHP template file used to render the page you are editing. In our case we are using categories and we\u0027ll edit the single-webinar.php file.\n\nFirst, let\u0027s add the PHP code:\u003C/p\u003E\u003Cp\u003EThis PHP code sets a local variable \u003Cb\u003E$dailystory_form_redirect\u003C/b\u003E to the value set in our WordPress custom field \u003Cb\u003Edailystory_form_redirect\u003C/b\u003E:\u003C/p\u003E\u003Cdiv class=\u0022code\u0022 data-language=\u0022html\u0022\u003E$dailystory_form_redirect = get_post_custom_values(\u0027dailystory_form_redirect\u0027)[0];\u003C/div\u003E\u003Cp\u003ENext, we need to add some JavaScript in the footer of our page. This JavaScript is used to determine if the person viewing the page has completed the form required to view the on-demand webinar.\n\nIt\u0027s important to note here, that this is not meant to be secure. It is meant only to create enough friction in the user experience to enforce registration. We\u0027ll simply use the browser\u0027s local storage to check to see if we have a value for \u0027ds_form_submit\u0027. If we do not, we\u0027ll redirect the browser to the value set in the \u003Cb\u003Edailystory_for_redirect\u003C/b\u003E custom field.\u003C/p\u003E\u003Cdiv class=\u0022code\u0022 data-language=\u0022javascript\u0022\u003E\u003Cscript\u003E\r\n\r\n    document.addEventListener(\u0027DOMContentLoaded\u0027, function() {\r\n        const registered = localStorage.getItem(\u0027ds_form_submit\u0027);\r\n        const redirect = \u0022\u003C?php echo $dailystory_form_redirect ?\u003E\u0022;\r\n\r\n        if (redirect.length \u0026gt; 0 \u0026amp;\u0026amp; !registered)\r\n        {\r\n            console.log(\u0022Not registered. Redirecting...\u0022);\r\n            console.log(\u0022\u003C?php echo $dailystory_form_redirect ?\u003E\u0022);\r\n            window.location.href = \u0022\u003C?php echo $dailystory_form_redirect ?\u003E\u0022;\r\n        } else {\r\n            console.log(\u0022Registered or not required.\u0022);\r\n        }\r\n    });\r\n\r\n\u003C/script\u003E\u003C/div\u003E\u003Cp\u003EThe ds_form_submit is a value that DailyStory sets in the browser\u0027s local storage whenever a DailyStory form is submitted. If the value exists, it means the person has previously submitted a form.\n\nNow our landing page is complete. When a visitor attempts to access it, if they have not registered they will be redirected to our form page.\u003C/p\u003E\u003Ch2 id=\u0022lead_magnet_form_page\u0022\u003ELead Magnet Form Page\u003C/h2\u003E\u003Cp\u003EThe Lead Magnet Form Page is the page that visitors will receive if they attempt to access the lead magnet without registering. We\u0027ll provide some details about the webinar and include an HTML form that visitors must complete to watch the webinar on-demand.\u003C/p\u003E\u003Ch3 id=\u0022create_a_web_form_in_dailystory\u0022\u003ECreate a web form in DailyStory\u003C/h3\u003E\u003Cp\u003EStep one is to \u003Ca href=\u0022https://docs.dailystory.com/article/5itiwxukqb-daily-story-web-forms\u0022\u003Ecreate a web form in your DailyStory account\u003C/a\u003E. DailyStory provides a drag-and-drop form builder that makes it easy to quickly create a form. Below is the web form designer where a simple form was built to collect name and email address.\n\nWhen a web form is submitted the contact data is used to create a new record in the campaign the web form is associated with. And, you can also create an automation to send notifications, emails, text messages, Slack messages, and more when the web form is submitted.\u003C/p\u003E\u003Ch3 id=\u0022embed_your_web_form_using_a_wordpress_short_code\u0022\u003EEmbed your web form using a WordPress short code\u003C/h3\u003E\u003Cp\u003ENext, edit your form page in WordPress and add the DailyStory web form short code. You\u0027ll need your \u003Ca href=\u0022https://docs.dailystory.com/article/h766zz7ies-create-or-edit-a-web-form\u0022\u003Eweb form id\u003C/a\u003E and the URL to your lead magnet. For example, a web form ID might be \u003Cb\u003EKt837F\u003C/b\u003E and the URL to the lead magnet may be https://www.dailystory.com/webinar/email-marketing-best-practices/.\u003C/p\u003E\u003Cp\u003E\u003Ccite class=\u0022warning\u0022\u003E\u003Cspan class=\u0022title\u0022\u003EWarning\u003C/span\u003E\u003Cp\u003ENote, the \u003Ca href=\u0022https://wordpress.org/plugins/dailystory/\u0022\u003EDailyStory WordPress plugin\u003C/a\u003E must be installed for the web form short code to work.\u003C/p\u003E\u003C/cite\u003E\u003C/p\u003E\u003Cdiv class=\u0022code\u0022 data-language=\u0022json\u0022\u003E[[ds-webform id=\u0022Kt837F\u0022 redirect_url=\u0022https://www.dailystory.com/webinar/email-marketing-best-practices/\u0022]]\u003C/div\u003E\u003Cp\u003EThe redirect_url parameter is optional. It redirects the browser to the provided URL after the form is submitted successfully. This is useful for situations where you create a single form and use to for multiple lead magnets. You could optionally create a separate form for each lead magnet too.\u003C/p\u003E\u003Ch2 id=\u0022in_summary\u0022\u003EIn Summary\u003C/h2\u003E\u003Cp\u003EWe\u0027ve created 2 pages in WordPress. One hosts a DailyStory web form and the other hosts our on-demand webinar. When the form is submitted we redirect to the on-demand webinar landing page. If the landing page find the ds_webform_submit value in local storage the page is shown, if not it redirects back to the form page.\n\nWhat we didn\u0027t show is what happens in DailyStory:\u003C/p\u003E\u003Cul\u003E\u003Cli\u003ENew lead created when form submitted\u003C/li\u003E\u003Cli\u003EAutomatic notifications sent\u003C/li\u003E\u003Cli\u003EOptionally run automations, such as a follow-up thank you email\u003C/li\u003E\u003C/ul\u003E",
      "publish_status": 0,
      "post_type": "Article",
      "featured_image_updating": false,
      "meta_description": "Learn how to use on-demand webinars as a lead magnet with DailyStory and WordPress, set up web forms, automate follow-ups, and grow your leads fast.",
      "display_toc": true,
      "has_workingcopy": false,
      "allow_indexing": true,
      "sort_order": 7,
      "total_views": 130,
      "date_published": "2026-03-13T18:11:13.037",
      "date_updated": "2026-03-19T20:48:00.213",
      "date_created": "2026-03-13T17:30:29.347"
    }
  }
}