This process can be used for any Shopify page in your theme that has a Custom Liquid section/block or within 'Pages' using the HTML editor.
If you have not already, install the Patch Pixel on your Shopify store by following the instructions in this article: How to install Pixel in Shopify.
Build and save a Form. For instructions on how to build a form click here.
Use the Automatic Installation option, which can be found in the Forms module -> Step 5: Installation. Follow these instructions from within your Patch account:
Locate and edit the Form you want to embed. Navigate to Step 5: Installation. Click the purple plus button in the data table within the Automatic Installation section.
The ‘Form Setup’ dialog will open.
By default, the form you are building/editing is selected.
Click the dropdown for Form Type and select ‘Embedded’.
Insert a Unique ID: Choose a unique ID to use for embedding this form onto your site. Make sure this unique ID is easily recognizable and pertains to this specific form. Unique IDs must be globally unique. An example would be embedding a form on your contact page in which a unique identifier could be #contact-page-form.
When entering the unique ID for this setting start with a '#' (hashtag) and then include a '-' (dash) in between each word you are using.
If you do not include the # the element will throw an error and the settings cannot be saved until this is corrected.
Once you have set your unique ID you will then need to copy the script provided in the dialog.
Base script: <div id="your-element-id"></div>
Examples:
<div id="contact-page-form"></div>
or
<div id="blog-newsletter"></div>
Take the script you just copied and paste it into a custom code /HTML block on your site where you want the form to show. Note: Only one HTML element ID can exist per page.
Installing Script Onto Your Site
You have three options where this code will propagate onto your site without additional development. You will have to use the Custom Liquid block, Custom Liquid section, or the HTML code editor that is available on ‘Pages’ only. Where on your site these elements are available is dependent upon your theme or custom development.
Log in to your Shopify store. Using the left-side menu navigate to 'Online Store'.
A submenu will appear, depending on which page you want to embed the form on you will either go to 'Themes' or 'Pages'.
Theme Editor:
If you want to embed the form on a page under your 'Theme' you will then click on 'Customize' in the main view of the screen.
Navigate to the page you want to embed the form on. By default, the theme editor opens to the 'Home page'. Note: Not all pages listed within the theme editor have Custom Liquid Sections or Blocks that are compatible with the div script. Also, not all elements of the theme builders will have the options for either of these elements and this is controlled by your Shopify Theme and will vary per account.
Use the left-side menu to select where on the page you want to embed the form. For this example, we will use the Home page. Find a section that allows for a Custom Liquid block or scroll down to where you can add a new section and use the 'Add Section' button.
Then for the section type search or scroll down and click 'Custom Liquid'.
Note: If this page does not have either of these options then the form cannot be embedded using the Automatic Installation option. If you have a website development team or IT dept you can reach out to them to manually install a form on your site.
Usually, the 'Add section' option is towards the bottom of the page, to adjust where the form is placed you can drag the element up or down.
The section editor will open and you will paste the div script you copied from your Patch account here. Then click 'Save'.
Please note the preview screen within the editor is not completely accurate in how the form will look on your site. Load the page in your browser to view it. Please note additional styling will require knowledge of HTML and CSS that can be applied either within the Custom Liquid section or your Form Editor in Patch.
View in browser:
Pages Editor:
If you want to embed the form on a page listed under your 'Pages' you will click this menu option and choose from the available pages or create a new one.
Once you have the page opened you will use the HTML Code editor to paste your script into.
Save your changes and view the page. Note: If the form does not show immediately try clearing your cache. If this does not get the form to appear you may need to wait up to an hour for the pixel to propagate these changes on your site.
Comments
0 comments
Please sign in to leave a comment.