Step 1.
Go to poly.google.com to create your 3D tour. Create a tour based on one of the templates, or choose an existing one.
Step 2.
When you're ready, publish the tour (making it public) and then open it. You'll see an option to Share. Click on that and then choose the Embed option to get the code.