Content block snippets can be used for many other purposes, such as adding analytics, affiliate, comparison, and social media tracking codes, or for simply adding simple site inclusions such as logos, wallpaper, and promotional messages to specific areas of the site.
To use this tool, there needs to be an appreciation of the code and structure of the site(s) and channels being serviced.
It is advised that all changes should be carefully tested before they are applied to the live site, to avoid any detrimental impact on customer experience.
- Go to Storefront>Content Blocks
- Click New Content Block
- Select the folder
- Fill out the details as per your requirement for more details refer to the below table
- Click Save
Snippets list can be seen and filtered based on the below filters:
- Status: Active or Inactive
- Dynamic Type: Yes or No
- Show Across Site: Yes or No
A good example of where this could be useful is in the inclusion of Google Analytics tagging, where tags are required to be added within different locations e.g. Head or Body tags.
In the examples below, we explore some examples of how snippets can be used in practice.
Drilling down into the individual snippets you can see that we have two examples of how Google Analytics (GA) can be applied to a site using a content block.
Configuration: The snipped of HTML code to be added to the entire site and applied across the (desktop, in-store, mobile, tablet, and web) site(s).
The code being added here is the account number for GA, which in this case is the same across all sites.
Note- BetterCommerce allows you to create multiple folders and move individual snippets to these folders as well