If you want to trigger an SMS and use a data extension and don't want to use the Smart Capture approach as described by fromero, you need to use the REST API. You can do this with use of QueueMO method you're referring to: QueueMO REST API. This can be done with HTTP request SSJS function, see this post for further information: REST API Methods in AMPScript ...
You can create a Journey using the CloudPage as entry source. Then, when someone submits it, will be automatically injected in the journey where the SMS is sent. Just remind to add that field in the Data Extension.
There are two functions in AMPscript that let you retrieve the parameters sent by the request message.
QueryParameter - Only usable for GET-parameters (suitable for your use case)
RequestParameter - Usable for GET- and POST-parameters (also suitable for your use case)
So your code would look like this:
You would also need to have a list of the Asset Ids ...
I would recommend you to follow a headless approach to this :-)
How I have done this before is by building JSON code resources in Cloud Pages, exposing the data from SFMC in a way allowing it to be fetched, parsed and committed using JS. Let's follow an example:
You build a page on your existing website: www.example.com/preferences
When building a ...
You can add the cloud page as a iframe to embed the preference page within a website. There would be rendering/design issues that you would need to think about when doing this though. As if the preference page is too long you can have double scroll bars which isn't the best ux design on a page.
Stringify the payload, to change your JS object to a JSON string.
var accessTokenResult = HTTP.Post(url, contentType, Stringify(payload), headerNames, headerValues);
I've found that error usually points to a function syntax error or incorrect function parameters.
Although not directly an answer to your question, this might help - you will be able to see the load time of each asset on your CloudPage:
Open the CloudPage in Chrome and use Chrome developer tools to measure the load time.
Open the CloudPage in Chrome, then right-click and select inspect or hit F12 to open the console
In the console, click on the ...
You're missing an ENDIF at the after your CreateSalesforceObject function call. Secondly, looks like you're overwriting the value of @id. Seems like the second instance should be @contactID.
Regarding my comment about outputting the values before doing the operations -- here's what I mean:
var @id, @row, @campaignId, @emailParam, @SfCampaign