A method of anchoring a joining element in an object, the method comprising the steps of: - Providing joining element, the joining element comprising an anchoring portion for in-depth anchoring in the object, and a head portion proximally of the anchoring portion, the head portion having a lateral outer surface with a well-defined structure, the joining element comprising a thermoplastic material at least on a surface of the anchoring portion; - Positioning the joining element relative to the object in a manner that the anchoring portion reaches into an opening of the object or is placed adjacent a mouth thereof; and - pressing the joining element towards a distal direction and at the same time coupling mechanical vibration energy into the joining element by a tool in an amount and for a time sufficient for liquefaction of a portion of the thermoplastic material to cause interpenetration of the thermoplastic material into structures of the object, wherein - the pressure and the mechanical vibration are applied by pressing the tool against a proximal end face of the head portion, and in the step of pressing, a coupling-out face of the tool is pressed against the proximal end face of the joining element, a tool-joining-element-interface being formed between the coupling-out face and the proximal end face, wherein the interface has a smaller radial extension than a radial extension of the head portion by the head comprising a proximal protrusion a radial extension of which is smaller than the radial extension of the head portion, - or in that the head portion comprises a recess open to the proximal side, and the pressure and the mechanical vibration are applied by the tool to a coupling face within the recess, - whereby the method comprises leaving the lateral outer surface of the head portion intact. - Providing joining element, the joining element comprising an anchoring portion for in-depth anchoring in the object, and a head portion proximally of the anchoring portion, the head portion having a lateral outer surface with a well-defined structure, the joining element comprising a thermoplastic material at least on a surface of the anchoring portion; - Positioning the joining element relative to the object in a manner that the anchoring portion reaches into an opening of the object or is placed adjacent a mouth thereof; and - pressing the joining element towards a distal direction and at the same time coupling mechanical vibration energy into the joining element by a tool in an amount and for a time sufficient for liquefaction of a portion of the thermoplastic material to cause interpenetration of the thermoplastic material into structures of the object, wherein - the pressure and the mechanical vibration are applied by pressing the tool against a proximal end face of the head portion, and in the step of pressing, a coupling-out face of the tool is pressed against the proximal end face of the joining element, a tool-joining-element-interface being formed between the coupling-out face and the proximal end face, wherein the interface has a smaller radial extension than a radial extension of the head portion by the head comprising a proximal protrusion a radial extension of which is smaller than the radial extension of the head portion, - or in that the head portion comprises a recess open to the proximal side, and the pressure and the mechanical vibration are applied by the tool to a coupling face within the recess, - whereby the method comprises leaving the lateral outer surface of the head portion intact.