0

I have an ampscript with CreateSalesforceObject code, this code creates a record on service cloud for every email sent by marketing cloud.

My question is, can someone clarify the trigger point of ampscript, will the ampscript trigger everytime the user opens the email?

  • What Markus said. Be very careful when using the Salescloud integration AMPScript methods in emails. This can lead to very slow sendout performance - definitely don't do this in Bulk sendouts with large numbers, individual emails should work ok. – Jonas Lamberty Jun 9 at 9:02
  • Agreed. It works OK in triggered sends or in 1:1 journeys. For bulk sends you could send data to a data extension, and push it to Service Cloud later on, using bulk api and SSJS – Lukas Lunow Jun 9 at 10:18
2

AMPscript is evaluated on the server side at send-time. So it is evaluated for every preview of the email as well as every email sendout. Opens don't re-process AMPscript.

The system processes the script at the point where you include it in the message to render content on a subscriber-by-subscriber basis. The Marketing Cloud application handles all AMPscript calls at the end of the email send.

(Source: Introduction to Programmatic Marketing Content)

If you need to exclude Test sends, you can retrieve the context of the message and don't execute the CreateSalesforceObject-call for tests.

IF (_messagecontext != "PREVIEW" AND _isTestSend != true) THEN
    CreateSalesforceObject(.....
ENDIF
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.