If I understand correctly: You're looking for a way to reliably tie previously played game ID's to an account if the user eventually logs on?
Well one method is to track all played game ID's within a cookie, and upload and reset that cookie's content if the user eventually logs on. As to tracking said games across browsers and devices: One method would be to tie IP-addresses to the game ID's and track it that way. However, just be aware that this method may not work if multiple members in the same household who share the same public IP, tries to play. One way to combat this could be to also do fingerprinting. Doing this might be more effort than the result is worth. I'd say try not to worry too much about it, and just stick to simple cookies.
Just be aware however: Doing such tracking and fingerprinting without consent is illegal in areas subject to GDPR regulations.