Hey MarilleTielens - AprilTag detection already gives you the tag ID and corner coordinates on every frame, so you can use the ID to track the same marker over time.
If you also need its distance/3D position, align the stereo depth to the RGB stream and then sample the aligned depth at the tag center (or a small region inside it). StereoDepth/Depth alignment is the preferred path; ImageAlign is useful for more general alignment cases.
The 12MP AprilTag example is a good starting point: https://docs.luxonis.com/software-v3/depthai/examples/april_tags/april_tags_12mp/
If you use a coding agent, Luxonis Agent Skills can help create a working proof of concept: npx skills@latest add luxonis/skills, then use luxonis-build-poc.
Thanks,
Oskar