Engine Framework
Custom code and analytics
Add custom CSS, JavaScript, extra HTML such as analytics or chat widgets, and Google Analytics or Tag Manager IDs to an Engine Framework template.
The Custom code group of the options panel holds your own CSS, JavaScript and HTML. The Advanced group holds the analytics IDs. Everything here is saved on the template style, so each style can have its own code.
CSS and JavaScript
| Option | What it does |
|---|---|
| Custom CSS | Added to every page that uses this style. It shows in the preview as you type. |
| Custom JavaScript | Added to every page that uses this style. Save to see it in the preview. |
Write plain CSS and JavaScript, without <style> or <script> tags.
The template's colours, fonts and sizes are CSS variables, so your CSS can reuse them. For example:
.my-note {
background: var(--en-soft);
border-left: 4px solid var(--en-primary);
border-radius: var(--en-radius);
}Other variables include --en-accent, --en-ink, --en-muted, --en-bg, --en-line, --en-font-body and --en-font-heading.
To style one row of the page layout, give it a CSS class in its Row settings and target that class. See Page layout.
Extra HTML
"For analytics or chat widgets. Printed as you type it."
| Option | Where it goes |
|---|---|
Before </head> | At the end of the page head |
Before </body> | At the end of the page body |
Paste the full snippet a service gives you, including its <script> tags.
Analytics
In Advanced > Analytics:
| Option | Example |
|---|---|
| Google Analytics ID | G-XXXXXXXXXX |
| Google Tag Manager ID | GTM-XXXXXXX |
Enter only the ID. The template adds the Google code for you. If you already add Google Analytics through Google Tag Manager, fill in only the Tag Manager ID so visits are not counted twice.
Several styles
Custom code belongs to one template style. If your site uses two styles (for example two Engine themes, see Two Engine templates on one site), add the code to both, or export the settings of one style and import only what you need. See Template options.