Below you can find the issue that I am facing. Basically when I click on a custom button to download a pdf, randomly during the first one or two Analytics call I have the value Download Link = undefined and after I have Custom Link with the value that I want to track. I think that I am tracking the first Analytics server call. Do you have some suggestion how to fix this issue? And what is the difference between Download Link and Custom Link?
When we try to download a file, the AA will automatically track the respective file if the s.trackDownloadLinks= true is configured. you can configure this in launch either "configure tracker using custom code" or Link Tracking
If you want to track downloads without using the OOTB then you can disable below configurations, but you need to handle same in your custom event which you call when you click on download button