You can add your custom tracking code to the theme functions.php file, based on this:
The embedded code above can be accessed directly from the Gist here. Please note! We are not able to provide support for customizations, so if you need further assistance implementing this code, please reference the recommended Woo Workers.
The order object contains all the order data you should need, including line items.