I'm trying a new lead gen piece where interested clients sign up for a newsletter on a cloud page.
I want to create a new contact for signups by sending up to service cloud using the object create function in journeybuilder OR CreateSalesforceObject() AMPScript but struggling at the moment. My previous attempts at using journey builder created odd subscriber accounts where the email address was input as the subkey and ultimately then creating contacts without proper subkeys. What would be the best way around this? The current attempt at using AMPScript looks like this, but upon submission, going through to the thank you page breaks when the email parameter is not empty.
%%[SET @email = RequestParameter('emailAddress') IF NOT EMPTY(RequestParameter("emailAddress")) THEN VAR @subscriberKey SET @subscriberKey = CreateSalesforceObject( "MC_Candidate", 4, "MC_EMAIL__c", RequestParameter("emailAddress"), "MC_CONTACT_BY_EMAIL__c", RequestParameter("marketingOptIn"), "MC_DAILY_NEWSLETTER__c", RequestParameter("dailyNewsletter"), "MC_SOURCE__c", RequestParameter("source") ) ]%%