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. Jun 9, 2020 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 Jun 9, 2020 at 10:18

1 Answer 1


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .