Thanks guys
These are the instructions I received on the code that needs adding:
Sample Code
The following code requires js-cookie available from https://github.com/js-cookie/js-cookie
Script to get parameters from the URL and save them to a cookie
Script to get parameters from cookies and add them to all tracking links