Both ids are unique to a document. The tracking ID for a document is the same for all document versions. The document ID is unique for each document version.
Solution: See comment above.