{"id":1260,"date":"2020-08-12T17:05:18","date_gmt":"2020-08-12T17:05:18","guid":{"rendered":"https:\/\/sweepwidget.com\/docs\/?p=1260"},"modified":"2026-01-17T22:51:54","modified_gmt":"2026-01-17T22:51:54","slug":"auto-login-user-with-pre-filled-data","status":"publish","type":"post","link":"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data","title":{"rendered":"Auto-Enter User From Your Website&#8217;s Logged In User Session \/ Cookie Data"},"content":{"rendered":"\n<p><strong>Premium plan is required for this feature.<\/strong><\/p>\n\n\n\n<p>In this article, we will learn how to auto-login a user with pre-filled data from your website. You can auto-fill the name, email, and whether or not to auto-log them in.<\/p>\n\n\n\n<p><strong>Example of how this works:<\/strong><\/p>\n\n\n\n<p>If a user is logged into your website and hasn&#8217;t entered a SweepWidget giveaway yet, you can auto-fill the name\/email. You would be pulling this data from the session data on your website and populating the SweepWidget form with it. Furthermore, you can automatically have them enter the giveaway with this name\/email combination.<\/p>\n\n\n\n<p><strong>Implementation instructions:<\/strong><\/p>\n\n\n\n<p>You will need to add 3 parameters to the <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/sweepwidget.com\/docs\/how-to-embed-a-giveaway-into-your-website\" target=\"_blank\" rel=\"noreferrer noopener\">embed code<\/a> for your giveaway.<\/p>\n\n\n\n<p>Here&#8217;s an example embed code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=\"29218-9c7ong3k\" class=\"sw_container\"&gt;&lt;script type=\"text\/javascript\" src=\"https:\/\/sweepwidget.com\/w\/j\/w_init.js?v=3\"&gt;&lt;\/script&gt;&lt;\/div&gt;<\/code><\/pre>\n\n\n\n<p>You would need to add the following 3 parameters:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>data-email-prefill=\"name@email.com\"\ndata-name-prefill=\"John Doe\"\ndata-auto-login-prefill=\"1\"<\/code><\/pre>\n\n\n\n<p>The values to each of these parameters would be pulled from your session or cookie data. Here&#8217;s an example implementation using PHP:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div id=\"29218-9c7ong3k\" class=\"sw_container\" data-name-prefill=\"Test\" data-email-prefill=\"lisa.test@sweepwidget.com\" data-auto-login-prefill=\"1\"&gt;&lt;script type=\"text\/javascript\" src=\"https:\/\/sweepwidget.com\/w\/j\/w_init.js?v=3\"&gt;&lt;\/script&gt;&lt;\/div&gt;<\/code><\/pre>\n\n\n\n<p>Also, you can set data-auto-login-prefill to either <strong>1<\/strong> or <strong>0<\/strong>. If it&#8217;s set to 1 it will auto-log them in. If it&#8217;s set to 0, it won&#8217;t.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to auto-log user in on hosted landing page with URL parameters?<\/h2>\n\n\n\n<p>You can also pass the name, email, and whether or not to auto-log a user in by passing specific parameters of the URL address bar on your hosted SweepWidget landing page. You simply need to pass the following 3 parameters:<\/p>\n\n\n\n<p><strong>data-name<\/strong><\/p>\n\n\n\n<p><strong>data-email<\/strong><\/p>\n\n\n\n<p><strong>data-auto-login<\/strong> (use 1 for yes and 0 for no)<\/p>\n\n\n\n<p>Example link:<\/p>\n\n\n\n<p><a href=\"https:\/\/sweepwidget.com\/c\/438-tu2zjsh4?data-name=Steven&amp;data-email=test.user@example.com&amp;data-auto-login=0\">https:\/\/sweepwidget.com\/c\/438-tu2zjsh4?data-name=Steven&amp;data-email=test.user@example.com&amp;data-auto-login=0<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Premium plan is required for this feature. In this article, we will learn how to auto-login a user with pre-filled data from your website. You can auto-fill the name, email, and whether or not to auto-log them in. Example of how this works: If a user is logged into your website and hasn&#8217;t entered a SweepWidget giveaway yet, you can auto-fill the name\/email. You would be pulling this data from the session data on your website and populating the SweepWidget form with it. Furthermore, you can automatically have them enter the giveaway with this name\/email combination. Implementation instructions: You will need to add 3 parameters to the embed code for your giveaway. Here&#8217;s an example embed code: You would need to add the following 3 parameters: The values to each of these parameters would be pulled from your session or cookie data. Here&#8217;s an example implementation using PHP: Also, you can set data-auto-login-prefill to either 1 or 0. If it&#8217;s set to 1 it will auto-log them in. If it&#8217;s set to 0, it won&#8217;t. How to auto-log user in on hosted landing page with URL parameters? You can also pass the name, email, and whether or not to auto-log a user in by passing specific parameters of the URL address bar on your hosted SweepWidget landing page. You simply need to pass the following 3 parameters: data-name data-email data-auto-login (use 1 for yes and 0 for no) Example link: https:\/\/sweepwidget.com\/c\/438-tu2zjsh4?data-name=Steven&amp;data-email=test.user@example.com&amp;data-auto-login=0<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62],"tags":[],"class_list":["post-1260","post","type-post","status-publish","format-standard","hentry","category-manage-entries"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Auto-login user with pre-filled data | SweepWidget<\/title>\n<meta name=\"description\" content=\"In this article, we will learn how to auto-login a user with pre-filled data from your website. You can auto-fill the name, email, and whether or not to auto-log them in.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Auto-login user with pre-filled data | SweepWidget\" \/>\n<meta property=\"og:description\" content=\"In this article, we will learn how to auto-login a user with pre-filled data from your website. You can auto-fill the name, email, and whether or not to auto-log them in.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data\" \/>\n<meta property=\"og:site_name\" content=\"SweepWidget Help Docs\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-12T17:05:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-17T22:51:54+00:00\" \/>\n<meta name=\"author\" content=\"SweepWidget\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"SweepWidget\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/auto-login-user-with-pre-filled-data#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/auto-login-user-with-pre-filled-data\"},\"author\":{\"name\":\"SweepWidget\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/#\\\/schema\\\/person\\\/4cca2bc9c600116750eca1bfff6648e0\"},\"headline\":\"Auto-Enter User From Your Website&#8217;s Logged In User Session \\\/ Cookie Data\",\"datePublished\":\"2020-08-12T17:05:18+00:00\",\"dateModified\":\"2026-01-17T22:51:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/auto-login-user-with-pre-filled-data\"},\"wordCount\":267,\"articleSection\":[\"Manage Entries\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/auto-login-user-with-pre-filled-data\",\"url\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/auto-login-user-with-pre-filled-data\",\"name\":\"Auto-login user with pre-filled data | SweepWidget\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/#website\"},\"datePublished\":\"2020-08-12T17:05:18+00:00\",\"dateModified\":\"2026-01-17T22:51:54+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/#\\\/schema\\\/person\\\/4cca2bc9c600116750eca1bfff6648e0\"},\"description\":\"In this article, we will learn how to auto-login a user with pre-filled data from your website. You can auto-fill the name, email, and whether or not to auto-log them in.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/auto-login-user-with-pre-filled-data#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/auto-login-user-with-pre-filled-data\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/auto-login-user-with-pre-filled-data#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Auto-Enter User From Your Website&#8217;s Logged In User Session \\\/ Cookie Data\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/#website\",\"url\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/\",\"name\":\"SweepWidget Help Docs\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/#\\\/schema\\\/person\\\/4cca2bc9c600116750eca1bfff6648e0\",\"name\":\"SweepWidget\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/08ae098bc2290a9a645af1c26ddd7704f98d09c88bf65a55b5c4bc1e585f31f4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/08ae098bc2290a9a645af1c26ddd7704f98d09c88bf65a55b5c4bc1e585f31f4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/08ae098bc2290a9a645af1c26ddd7704f98d09c88bf65a55b5c4bc1e585f31f4?s=96&d=mm&r=g\",\"caption\":\"SweepWidget\"},\"sameAs\":[\"https:\\\/\\\/sweepwidget.com\\\/docs\"],\"url\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/author\\\/sweepwidget\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Auto-login user with pre-filled data | SweepWidget","description":"In this article, we will learn how to auto-login a user with pre-filled data from your website. You can auto-fill the name, email, and whether or not to auto-log them in.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data","og_locale":"en_US","og_type":"article","og_title":"Auto-login user with pre-filled data | SweepWidget","og_description":"In this article, we will learn how to auto-login a user with pre-filled data from your website. You can auto-fill the name, email, and whether or not to auto-log them in.","og_url":"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data","og_site_name":"SweepWidget Help Docs","article_published_time":"2020-08-12T17:05:18+00:00","article_modified_time":"2026-01-17T22:51:54+00:00","author":"SweepWidget","twitter_card":"summary_large_image","twitter_misc":{"Written by":"SweepWidget","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data#article","isPartOf":{"@id":"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data"},"author":{"name":"SweepWidget","@id":"https:\/\/sweepwidget.com\/docs\/#\/schema\/person\/4cca2bc9c600116750eca1bfff6648e0"},"headline":"Auto-Enter User From Your Website&#8217;s Logged In User Session \/ Cookie Data","datePublished":"2020-08-12T17:05:18+00:00","dateModified":"2026-01-17T22:51:54+00:00","mainEntityOfPage":{"@id":"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data"},"wordCount":267,"articleSection":["Manage Entries"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data","url":"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data","name":"Auto-login user with pre-filled data | SweepWidget","isPartOf":{"@id":"https:\/\/sweepwidget.com\/docs\/#website"},"datePublished":"2020-08-12T17:05:18+00:00","dateModified":"2026-01-17T22:51:54+00:00","author":{"@id":"https:\/\/sweepwidget.com\/docs\/#\/schema\/person\/4cca2bc9c600116750eca1bfff6648e0"},"description":"In this article, we will learn how to auto-login a user with pre-filled data from your website. You can auto-fill the name, email, and whether or not to auto-log them in.","breadcrumb":{"@id":"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sweepwidget.com\/docs\/auto-login-user-with-pre-filled-data#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sweepwidget.com\/docs\/"},{"@type":"ListItem","position":2,"name":"Auto-Enter User From Your Website&#8217;s Logged In User Session \/ Cookie Data"}]},{"@type":"WebSite","@id":"https:\/\/sweepwidget.com\/docs\/#website","url":"https:\/\/sweepwidget.com\/docs\/","name":"SweepWidget Help Docs","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sweepwidget.com\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sweepwidget.com\/docs\/#\/schema\/person\/4cca2bc9c600116750eca1bfff6648e0","name":"SweepWidget","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/08ae098bc2290a9a645af1c26ddd7704f98d09c88bf65a55b5c4bc1e585f31f4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/08ae098bc2290a9a645af1c26ddd7704f98d09c88bf65a55b5c4bc1e585f31f4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/08ae098bc2290a9a645af1c26ddd7704f98d09c88bf65a55b5c4bc1e585f31f4?s=96&d=mm&r=g","caption":"SweepWidget"},"sameAs":["https:\/\/sweepwidget.com\/docs"],"url":"https:\/\/sweepwidget.com\/docs\/author\/sweepwidget"}]}},"_links":{"self":[{"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/posts\/1260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/comments?post=1260"}],"version-history":[{"count":13,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/posts\/1260\/revisions"}],"predecessor-version":[{"id":7110,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/posts\/1260\/revisions\/7110"}],"wp:attachment":[{"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/media?parent=1260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/categories?post=1260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/tags?post=1260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}