gaapgeek Posted May 30, 2020 Posted May 30, 2020 Hi there, I'm trying to add a Javascript snippet to insert an onboarding overlay to the homepage, but I can't seem to get it to work. Attached is a screenshot of the text to be added. Is anyone able to tell me exectly where I should add it? Thanks
Daniel F Posted May 31, 2020 Posted May 31, 2020 There's no need for a 3rd party plugin 🙂 Just add it to the analytics setting, which can be found in your ACP on the System => Analytics page.
gaapgeek Posted May 31, 2020 Author Posted May 31, 2020 Thanks Daniel - ideally, I only want the code on the homepage (I've created in Pages). what's the best way to add this snippet to the one page? 18 hours ago, Sonya* said: You can use this plugin
Sonya* Posted May 31, 2020 Posted May 31, 2020 4 hours ago, Daniel F said: Just add it to the analytics setting, which can be found in your ACP on the System => Analytics page. He has to include it before the <body>-tag. If he changes the location of JavaScript in the theme, then the script will fail. This will not happen with 3rd party plugin 😉 4 hours ago, gaapgeek said: I only want the code on the homepage (I've created in Pages). what's the best way to add this snippet to the one page? You can limit the script to one page only: {{if \IPS\cms\Pages\Page::$currentPage == 'YOURPAGE'}} your script {{endif}} Use this either in Analytics field or with the 3rd party plugin. gaapgeek 1
Recommended Posts