Please note
When placing a bookmark macro on a heading that is merged with the page title then the bookmark is not exported, for the following reasons:
- The page title is typically not placed directly in front of the content. Depending on your template there might be multiple pages for TOC, legals, etc. between the document title and the start of the exported content.
- The $scroll.title placeholder is typically considered as "text-only" and depending on the output format there is no consistent way of properly adding the bookmarks at that location.
- Placing such bookmarks on the text following the heading in Confluence would separate the bookmark from its original source. To achieve this simply put the macro manually into the first paragraph after the heading.
Since this only happens for the very top page and top heading of the exported content, you could link to the document as a whole.