I have created a sign up cloud page in marketing cloud and I want that page to be embedded in some other website. I know there are options like iFrame or DEmanager but iFrame are not that good for mobile devices and I want the data to be stored directly into salesforce not in any DE so DEmanager is also not an option. So is there any way to do that? I was also thinking to create a Lightning component and use Lightning Out to use it externally but it is also causing some problem. So is there any solution to achieve this or maybe any workaround for that?
I would advise you to a confirmation page as a Cloud Page, which accepts submitted values from a form you create natively on your landing page. This will use CreateSalesforceObject to upsert data and RequestParameter to fetch your submitted values:
%%[ var @email, @firstName, @lastName, @SFRecord set @firstName = RequestParameter('firstName') set @lastName = RequestParameter('lastName') set @email = RequestParameter('email') set @SFRecord = CreateSalesforceObject( 'Account', 3, 'FirstName', @firstName, 'LastName', @lastName, 'Email', @email) ]%%
Alternatively, you could create a JSON code resource with more or less similar code, allowing you to perform the POST using AJAX, keeping your visitor on your native website instead of redirecting to Cloud Pages.