You can put DITA2Go macro definitions in any of the following places:
The relative order in which macro definitions appear in a file is not important; what matters is the order in which they are invoked during conversion (see §37.1.2 Invoking a macro).
Do not end a file with a macro
Do not put a macro at the very end of a configuration file or library file. If you have no macro variables to define, and no [MacroVariables] section, end the file with a dummy section; for example:
Do not include macro definitions in a configuration template (see §39.5.2 Deciding what to include in a general configuration template).
Put complex macros in a separate file
If you create lengthy macros (for example, with a lot of conditional expressions), and you indent the code for readability, put the macros in a library file separate from the configuration file; or put each macro in its own macroname.txt file. That way the indentation is preserved. When DITA2Go updates your project configuration file as a consequence of changes you make to Export options, Windows rewrites the file, and deletes all leading spaces in the settings.