added affiliate id and widget id tracking into the API