I recently used some 3M Super 77 Multipurpose Adhesive that I got from Lowe's to glue my fabric trim back to the door.
Like others have said. Clean the two surfaces, then I would hit the carpet pretty good, as well as the backof the rubber. Have something heavy on hand to hold it down firmly to give it the best chance of adhesion.