Snapshots may display no metrics (0.00%) or unexpected metrics on specific elements or all elements due to changes made to a site page's HTML structure before or during a selected time period you are analyzing.
Why is there one or some element(s) displaying no metrics (0.00%)?
A change in the page's HTML structure
A very common root cause can be a change to your page's HTML structure that took place before the time period selected in your Analysis context.
Solution: Create a new snapshot of your live site to analyze and see if it displays metrics for that time period.
Example: An old snapshot from June is displaying no metrics (0.00%) for the October 1-31 time period due to a code update while the new snapshot is able to display metrics for this time period.
Note: Check the chosen time period in the Analysis Context. Was the Contentsquare tag placed during the selected dates Analysis Context?
Why are one or some element(s) displaying unexpected metrics?
A change to your page's HTML structure took place during the time period selected in your Analysis context.
Solution: Follow the instructions below for 'How to check for HTML structure changes' to confirm the unexpected metric is due to a code update and not unexpected user behavior.
Example: Updates made to the Contentsquare Expert page were implemented on May 26 and changed the HTML structure which impacted only the 'Use pages & mappings in your analysis' zone element. The May 22 snapshot can only display data from before the change while the June 2 snapshot can only display data from after the change.
May 22 Snapshot | June 2 Snapshot |
Analysis date range: May 1-30 | Analysis date range: May 1-30 |
Click rate: 4.70% (data collected using the old code live from May 1-26) | Click rate: 2.63% (data collected using the new code live starting on May 26) |
How to check for HTML structure changes
1. Select 'I want to analyze the current version of my Website' and 'Analyze a single URL' , then copy-paste the URL you are checking for HTML changes and click 'Let's go'
2. Select an older snapshot and then click the hamburger menu to display the Zones list and check the zone target (div) by clicking the see more options menu '...'
3. Click 'Snapshots' button and select the newer snapshot of your site and then repeat step 2 for the same zone and compare the Zone targets to see if the HTML structure has changed.
In this example the HTML structure has changed:
Dynamic IDs
Another possible root cause that can explain the low click rates is the use of Dynamic IDs.
In HTML, the ID is an attribute that is used to contain a specific element of the page using a unique value.
The value must be unique, thus being used only for one element on the whole page.
For example, the ID of the div remains static as “main-container“ on all the pages.
<div id = ”main-container”>
However, with Dynamic IDs, the value of the ID changes according to the conditions that are defined on the client's JavaScript code. The value can change for example by user ID, browser version, device, or a running test.
We aggregate the data by the path of each element. We calculate the position in the DOM of an element with which a user had an interaction thanks to a unique ID attribute and the position of the element.
The position is determined from the 1st ID while climbing up the DOM tree from the targeted element. When the element’s ID changes between the pages, the path of the elements won’t stay the same, thus showing different data or no data at all, causing confusion and preventing the user from getting the correct data.
How to check if there are Dynamic IDs on the page
- Enter the live site on Chrome.
- Click F12 (for Windows) or⌘CMD + Option +I (for Mac), to open Developer Tools.
- Click on ‘Inspect’ and locate the referred element’s ID.
- Check if the ID of the element contains a series of numbers, for example, “products422” or “container213”
Note: If you require a way to distinguish one block from the rest, you have the option to assign an ID, which will then be utilized by our tracking events mechanism. Read more in our technical guide.
Possible solutions if you have Dynamic IDs:
-
Our support team can implement a regex that matches that div ID to ignore, but if in the future, that div’s ID changes, then the solution will break. It doesn’t require action from your side. We will only need to know which pattern you are using for your Dynamic IDs.
- You can remove the dynamic IDs from those elements - It requires an action from your side.
- You can use a series of 4 numbers in your dynamic IDs. We automatically ignore IDs with more than 4 consecutive digits. It requires an action from your side.
- To ignore or override an ID, you can implement the data-cs-override-id attribute. It requires an action from your side. You can read more about it in our technical guide.
FAQ
Why, in some instances, are only some site elements impacted but not others?
- Not all site elements are impacted only those elements whose zone targets (divs) change due to changes made in the HTML structure (expand below for details).
HTML structure, zone targets, and data attribution
If your site’s HTML structure changes, an element(s)’ HTML path and therefore zone target (<div> tag used as a container for HTML elements) may be affected by that change too.
Contentsquare uses zone targets to correctly attribute data to a site element in Zoning analysis. This is the zone target for a particular shoe on a PLP, shown in the example below:
div#products>article:eq(1)>a:eq(0)>img:eq(0)
Pictured on the left, you can see how the HTML structure for the site page is related to the zone target. Therefore, changes made to that page's code that disrupt the position of the site element in the overall HTML structure can potentially change a zone target (div) despite there being no obvious visible UI changes made to the site element.
Why can't the site element display aggregate data from multiple site versions in Zoning analysis?
- A snapshot's site element can't display data from both its old zone target and its new zone target aggregately. It can only generate metrics from data collected and attributed to the element using the zone target that was live on your site when the snapshot was created.
When will my analysis be impacted?
- Your analysis will only be impacted when the date the HTML structure/ zone target changed is included in the data range you are looking to analyze (like in the first example given above) or you are analyzing a snapshot that cannot display any metrics for the period you are looking to analyze due to a code update that happened before the selected period (the second example given above).
Should I add an ID to all the elements of my site? On which blocks should I implement them? parent + child zones? just parent zones?
- Our tool scans through the parent chain of an element in the page to locate the first marker with an ID. If the marker has not been ignored, it is considered. If no IDs are found in the parent chain, the tool goes up to the tag. Then, it counts the position of the tag within identical markers as it goes back down.
It is recommended to utilize the ID attribute when there is a solitary element on the page that requires styling. It is important to note that IDs must be unique. Using an ID may be the appropriate choice, considering that there will likely be only one "main" div on the page. Some examples of IDs include: main-content, header, footer, or left-sidebar.
You can distinguish between the IDs, by giving an ID a unique name or by implementing the data-cs-override-id attribute. You can read more about it in our technical guide.Note: Visit our technical guide to learn more about how our tool targets the HTML elements.