A device for attaching a first product (1) to a second product (2) comprises an ultrasonic welding device (30) which is intended and adapted to realize a durable welded connection between a wall of the first product and the second product. The welding device comprises an ultrasonic welding torch (40,41) and an anvil (32,33) which are each displaceable between a rest position, clear of the first product and the second product, and an active position opposite each other in which a wall part of the first product and a strip-like part of the second product lie therebetween. First supply means (10) are provided for supplying the first product to the welding device (40,41). Second supply means (20,21,22) are further available which are suitable and intended for moving the second product (2) to the wall of the first product. The welding device (30) comprises a displaceable support arm (31) from which the anvil (31,32) extends together with at least one of the second supply means (20,21,22) and the ultrasonic welding torch (40,41).