Goals as affilate can it be done?

hi

i would like to do that every time user come from : example.com/blabla.php
to my site red.exmp.net

and than after i surf my site and enter to the exmp.net/team/buy.php and after he buy he goes by my script to
pay.php

i want that if he came firstly by example.com to my site and the user bought an item at the end

it will add to the spcefic goal money.

how it can be done if it can be?

thanks in advanced

if not do you know such script who can done this ?

anyone?

i feel as if the goals tracking is very shotty at best with piwik. i know its definitely off from what it says… i use a 3rd party affiliate tracking company which seems to work very accurately.