Our company runs a web site (oursite.com) with affiliate partners who send us traffic. In some cases, we set up our affiliates with their own subdomain (affiliate.oursite.com),
Sorry, but it's not going to work. The reason is because Google Analytics uses first-party cookies. This means the cookies that GA sets are specific to the domain the code is on. In your case, the iFrame is on a third-party domain. This means you're going to have two sets of GA cookies (one set for each domain), and no real way to reconcile the data.