Static assets scraping
In the context of Zoning and Session Replay, Contentsquare fetches static assets on your website.
To allow Contentsquare fetching these assets, select one of the following options:
- Allowlist Contentsquare IP addresses
- Use a static header to validate requests
- Use a dynamic signature header to validate requests
Allowing IP Addresses
Section titled Allowing IP AddressesAllow ports 80
(HTTP) and 443
(HTTPS) and the following IP addresses to prevent your proxy, firewall, or server configuration from blocking the scraper.
Using a custom static header
Section titled Using a custom static headerWhen selecting this option, Contentsquare adds a custom header to the project settings.
You can then validate that scraper requests contains the specific header and value.
Using a custom dynamic signature header
Section titled Using a custom dynamic signature headerWhen selecting this option, Contentsquare adds the X-CONTENTSQUARE-SIGNATURE
header to incoming requests from the scraper.
The X-CONTENTSQUARE-SIGNATURE
header is a string generated in this format:
with:
<TIMESTAMP>
: the time at which the request was sent usingDate.now()
,<RESOURCE_DOMAIN>
: the complete domain hosting the resource on your website,<SECRET>
: the secret shared between you and Contentsquare for the project, generated at project creation.
With a secret of abcde
, the Contentsquare scraper service has emitted the request below on contentsquare.com
on the 6th of August 2020 at 05:39 am, to fetch the official Contentsquare logo.
You can compute the signature and verify it against the value of the X-CONTENTSQUARE-SIGNATURE
header by providing:
- The timestamp from the incoming request (
1596706743675
), - The resource domain (
contentsquare.com
), - The secret provided by Contentsquare (
abcde
).