Problem/Motivation
When we install the VWO module, the VWO scripts are being added to every page on the website:
- Content pages (Nodes)
- Taxonomy term pages i.e. tags
- User page i.e. /user/1
- Admin pages i.e. /admin/config
Note: The moment I select 'Article' content type, the scripts are no longer added to the list above i.e. term pages, admin pages, etc
Concerns
- It performs two requests to https://dev.visualwebsiteoptimizer.com
- It adds extra load to the page
- It fills up the cache with copies of the page for each variation of cache contexts
Steps to reproduce
- Download and enable VWO module
- Configure the module with ID, etc, but don't select any content type
- Visit the pages below and observe that there are two calls to dev.visualwebsiteoptimizer.com
- Content pages (Nodes)
- Taxonomy term pages i.e. tags
- User page i.e. /user/1
- Admin pages i.e. /admin/config
Proposed resolution
First I would like to know if it is really necessary to add VWO scripts to every page or it is just node pages.
If it is node pages, we could add code to check if the page being viewed is a node. That would prevent the script from being added globally.
Once the site builder selects the node type, then we do as we do today i.e. filter by node type
Remaining tasks
- Understand the requirement for the script placement
- Fix the issue
Screenshots
The description does not mention that the scripts will be added to every page if we don't select a content type

| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Screenshot 2024-07-16 at 15.46.48.png | 110.46 KB | marcelovani |
Comments
Comment #2
marcelovaniComment #3
marcelovaniComment #4
marcelovaniComment #5
marcelovani