Writing the header and body scripts
ℹ️ Adding a script in your store's <header> ensures that it will be executed before any of the other HTML elements on the page are rendered. Although this may impair your store's performance, it is a good option if your Pixel app relies on the interaction between users and the store components. Adding a script in the store's <body> tag can increase performance rates, but at the cost of losing important user data while it is executed. Choose wisely according to your Pixel app functionality.
- Create a new file called header.html inside your app's pixel folder in order to add a script to a pages’s <header>.
- Create a new file called body.html inside your app's pixel folder in order to add a script to the end of the pages’s <body> tag.
- In the desired files, add the settingsSchema variable value - the same one used in the previous step. For example:
In the example above, we use the gtmID user identification.