Hello,
As default, replacements are done in the body target. You can set other targets: header, footer, comment, footnote and endnote using the target option available in template methods.
We recommend you read the following documentation page: Replace placeholders in targets and also the Practical guide Working with templates. Both pages detail replacements with samples.
Regards.