To make it possible to link the community content after it is migrated to Discourse to the correct page, I’m considering to use the external_id property.
I can set the property_id for each topic programmatically via the API, but I don’t know how to make use of it in the embedded code.
That would be useful for the case where you want to link existing posts from an external site with existing Discourse topics. That code would need to be added to each of the external posts that you wanted to link to Discourse. For each post, you would need to set the topicId parameter to the ID of the Discourse topic you wanted to link to.
If this doesn’t solve the problem for you, can you explain what you are trying to do in more details?