We identified a critical issue on the /portal/ pages where the canonical tag appeared correctly in the source code within the <head> section but ended up being rendered in the <body> section of the HTML. This discrepancy caused conflicting signals to Google, leading the search engine to ignore the canonical tag altogether.
During the investigation, we discovered that blocking a specific JavaScript file prevented the canonical tag from moving to the <body> section. The problematic file was:
https://www.globes.co.il/static/cache/js/header.js?ver=1@4b24
When this file was disabled, the canonical tag remained correctly positioned in the <head> section.
Further analysis suggested that the issue might be related to a function within the script called collector_feeder. This function uses the document.write() method to inject an iframe element into the DOM:
document.write(‘<iframe name=…’);
This action appeared to push certain blocks, including the canonical tag, down into the <body> section.
To address the issue, we followed a structured process:
We blocked the JavaScript file https://www.globes.co.il/static/cache/js/header.js?ver=1@4b24 and confirmed that the canonical tag no longer moved to the <body> section.
We reviewed the script to understand its impact on the DOM structure.
The collector_feeder function was found to be dynamically injecting iframes using document.write(). This method can manipulate the DOM post-load, causing unexpected behavior in the placement of elements.
We modified the problematic script to ensure that critical meta tags, including the canonical tag, remained in the <head> section.
We also implemented additional checks to prevent future manipulations of critical tags by third-party scripts.
After fixing the canonical tag placement issue, we observed a significant improvement in organic performance:
Organic clicks to the /portal/ pages increased
The issue with duplicate pages was resolved, leading to more efficient crawling and improved indexing by Google.
Always ensure that critical meta tags, especially canonical tags, remain in the <head> section.
Use browser developer tools to inspect the rendered HTML and identify potential DOM manipulations caused by JavaScript.
Regularly audit third-party scripts and CMS plugins to prevent unexpected changes to the page structure.
By addressing the canonical tag issue on the /portal/ pages, we demonstrated how small technical fixes can lead to substantial improvements in organic search performance.
We cut through the noise, get to the core, and execute with precision. Every move we make is backed by data, strategy, and real results—no guesswork, no gimmicks.
Copyright 2025 Cut Inside Ltd
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis rhoncus libero. Vivamus interdum fringilla erat.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis rhoncus libero. Vivamus interdum fringilla erat.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis rhoncus libero. Vivamus interdum fringilla erat.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis rhoncus libero. Vivamus interdum fringilla erat.