Placing HTML Markup in Xway

In Freeway Pro I placed the page visit code for Statcounter in Page > HTML Markup > Before </body>. I need help on where to place the code in Xway, it’s not the same as Freeway. Thanks.

Hi @dba53

According to the Xway User Guide, Chapter 13 (pages 145-149), you should use the “JavaScript Markup” section in Xway to insert tracking scripts like StatCounter.

To correctly place your StatCounter code in Xway, select your page or use the Document Inspector if you want it applied to all pages, open the Page Inspector, scroll to the “JavaScript Markup” section, choose “Before </body>” and insert your StatCounter code.

This is different from Freeway Pro, where you placed it in “Page > HTML Markup > Before”, which inserted the script before </head>. However, StatCounter officially recommends placing their tracking code just before the closing </body> tag, making Xway’s “JavaScript Markup (Before </body>)” the correct place for this.

I have verified that the StatCounter tracking code is JavaScript-based and checked their official installation guide at StatCounter support to confirm that this is the proper implementation method. But you should double checked that I’m not wrong in this assertion (e.g. I didn’t check the wrong site). Hope that helps.

1 Like

Thanks for the quick reply. I found the JavaScript Markup section. It has two choices of Head and Body. I chose Body and placed the Statcounter code in there and added at the end. Do I need to add the word Before or is the body tag all it needs?

Body is correct.

In Xway, the Generic Markup section of the Page Inspector provides the same functionality as Freeway’s Page Markup dialog.

The JavaScript Markup section just provides an easier interface, and automatically wraps the JavaScript in <script> tags. If the JavaScript you’re adding has already been wrapped in <script> tags, you should remove them.

JavaScript is often added in the Head section of a page, but sometimes it needs to be added in the Body section (choose Body from the popup in this case).

1 Like

Body tag is all you need (no add word).