HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubNuGetDev CommunitySubmit a ticketLog In

Use FreeOpenLocation with Forms

πŸ“˜

Prerequisites

  • Install EPiServer.Forms package from Nuget.
  • Access ipstack and get API key.
  1. Open Startup.cs file

  2. Add AddFreeGeolocationProvider to services object as below sample

    services
      .AddCmsAspNetIdentity < ApplicationUser > ()
      .AddCms()
      .AddVisitorGroupsUI()
      .AddCmsHost()
      .AddAlloy()
      .AddAdminUserRegistration()
      .AddEmbeddedLocalization < Startup > ().AddFreeGeolocationProvider("<http://api.ipstack.com/{0}?access_key=API_KEY")>;
    
  3. Obtain an API Key from ipstack and replace API_KEY with it.

  4. Deploy project to the online environment (because Loopback IP is ignored).

  5. Add Hidden visitor profiling into a form container and edit that element.

  1. Select Geo in the Auto-collect visitor data section with any value listed (such as City).
  1. Drag and drop the form to a page and publish it.

  2. Submit the form.

  3. Verify submission data.