Adding web counter to Shop-Script storefront

Google Analytics

Webasyst has built-in integration with the Google Analytics service; which makes it easy to connect it to your website. Simply save your Google Analytics Property ID in the settings.

  1. In Site app, open “Site settings” section.
  2. Copy & paste your ID to “Google Analytics Property ID” field.
    Google Analytics integration setting
  3. If you are using Universal Analytics in your Google account, then enable the appropriate checkbox next to the ID field. How to find out whether you are using Universal Analytics.
  4. Save Site settings.

How to add other web counters

A web counter is usually provided by various online services such as EasyCounter, StatCounter, etc. as a portion of JavaScript code which must be embedded in the source code of your website pages.

There are 2 methods of adding JavaScript code to your site.

Method 1. Additional JavaScript code in site settings

Use this method if you need to add counter code only before the closing </head> tag.

  1. In Site app, open “Site settings” section.
  2. Copy & paste the counter code to field “Additional JavaScript code to be added before the closing </head> tag” and save site settings.

Done: a counter has been added to your site.

Method 2. Adding of a block to design templates

  1. In Site app, open “Blocks” section.
  2. Add a new block, enter any ID for it (use Latin letters, digits, and underscore characters) and an arbitrary description, which is not visible on the site and will be there for your convenience only.
  3. Add the following lines to the block source code editing area.
    {literal}
    ... add your counter code here...
    {/literal}

    It is required to avoid curly brackets used in JavaScript from being inadequately processed by the Smarty engine, which is part of the Webasyst framework.

  4. Copy & paste your counter code between these two lines as shown above and save the block.
  5. Once you save the block, an automatically generated line of code (helper) will appear in its upper panel. Copy the helper.
  6. To get a web counter triggered on all website pages, add the helper to design theme template index.html; for example, as shown below:

Done: a counter has been added to your site.

0 comments

    Posting new comments is disabled for this topic.


    Раздел помощи работает на основе приложения «Хаб»