If you want to manually send data to the Rd station By Javascript, a simple way is to use the integration script that has its own method for submission, simplifying the process and making it unnecessary to create a request via custom AJAX.
The minimum required code would be as follows:
RdIntegration.post ([{name: 'email', value: 'Desired Email'}}, {name: 'identifier', value: 'How the conversion appears in RD Station'}, {name: 'token_rdstation', value: ' SEUTOKENPUBLICO '}, {name:' name ', value:' Desired Name}], null);
Here is a more complete example (using jQuery):
$ (document) .ready (function () {$ ("# send-rd"). click (function (event) {event.preventDefault (); var data_array = [{name: 'email', value: $ (" # email-rd "). val ()}, {name: 'identifier', value: 'How the conversion appears on RD Station'}, {name: 'token_rdstation', value: 'YOURPUBLIC'}, {name: ' name ', value: $ ("# rd -name"). val ()}]; RdIntegration.post (data_array, function () {alert ("Data sent successfully!")});}});
The above code captures the data from the # email-rd and # name-rd inputs and sends the POST to the click of the # send-rd button, and after sending, uses the callback of RdIntegration's own method to display an alert.
The code presented has no validation, which is necessary to keep your lead base clean, so it should only serve as an example to elaborate. Also remembering that this code necessarily needs to be executed after the RD Station integration script. I also leave below a slightly more elaborate JSFiddle.
Marten bjorkGot a question? Leave a comment! I often answer the same day.
Leave a Reply