Processing Cloudpage Forms using AJAX XHR / Fetch

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ต.ค. 2024

ความคิดเห็น • 5

  • @shivamv240
    @shivamv240 2 ปีที่แล้ว

    Thanks for this video shibu sir

  • @rickytyagi
    @rickytyagi 2 ปีที่แล้ว

    Thanks for creating this. Can we pass email context variables, such as the subscriber key, using this approach? Assuming we are sending the link to the cloud page in an email.

    • @sfmctrailblazers
      @sfmctrailblazers  2 ปีที่แล้ว

      Yes you can get those system personalization strings in the cloudpage if you use the CloudpagesURL ampscript function to redirect user from email to the cloudpage

    • @rickytyagi
      @rickytyagi 2 ปีที่แล้ว

      @@sfmctrailblazers In general we can, but can we also pass personalization strings between JSON code resource and the cloudpage used to submit data (using the XMLHttpRequest object). The XHR.open function has the second parameter set to the URL of the JSON code resource and in XHR.send(formData) we are sending the form input fields to be processed by the JSON code resource but not the personalization strings. Can we pass data in addition to the form fields in the same way as cloudpage does automatically via encrypted query string? As an example if we want to use this approach to unsubscribe and want to pass the subscriber key, email address, jobID, etc..

    • @sfmctrailblazers
      @sfmctrailblazers  2 ปีที่แล้ว

      @@rickytyagi technically you should be able to add hidden form fields in your cloudpage and those set to the personalization strings you get from the email. These then will automatically be sent to the code resource when the form gets posted frm the cloudpage