in my personal experience in vancouver from some years back it is check in immigration customs they won't let you go to the immigration desk without the boarding pass and customs always follow immigration in us airports or border crossings as well if one flies e g yhz yul ewr one checks in in halifax but only goes thru us immigration and customs in yul on the way to his us bound flight