How to Screenshot a HubSpot CMS Landing Page in PHP

How to Screenshot a HubSpot CMS Landing Page in PHP

author

Snapshot Site Team

09 Mar 2025 - 02 Mins read

HubSpot's CMS is a common landing spot for marketing and campaign pages, especially at companies whose core product runs on a completely different stack — which makes triggering a screenshot from wherever the rest of the marketing team's tooling already lives (frequently a PHP-based internal tool) a practical way to keep an eye on these pages.

Why HubSpot CMS Pages Have Their Own Quirks

  • Smart content and personalization can show different content to different visitor segments, so a plain capture reflects one specific personalization state, not necessarily every variant.
  • A/B tested modules mean the same URL can render one of several variants depending on which test bucket the request lands in — worth knowing if a screenshot looks slightly different between two captures of the "same" page.
  • Marketing pages are usually long, so a full-page capture is almost always the right default.

PHP Example

<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.prod.ss.snapshot-site.com/api/v1/screenshot",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json",
        "x-snapshotsiteapi-key: YOUR_API_KEY"
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "url" => "https://example.com/campaign-landing-page",
        "format" => "png",
        "width" => 1440,
        "height" => 900,
        "fullSize" => true,
        "hideCookie" => true
    ])
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;

Practical Recommendations

  • Capture logged-out, default-segment views for a consistent baseline, unless the specific point is checking a particular personalization variant.
  • Default to fullSize: true. Campaign landing pages are typically long, with pricing, testimonials, and form sections stacked below the hero.
  • Re-capture after any A/B test concludes and a winning variant is promoted, since the "default" rendering of the page has effectively changed.
  • Strip promotional banners with hide if a limited-time campaign banner shouldn't appear in a baseline QA capture.

Common Use Cases

  • Visual regression checks before a campaign launch
  • Archiving landing pages that change frequently during an active campaign
  • QA evidence that a personalization or A/B test variant renders correctly
  • Feeding a scheduled visual monitor, as described in Visual Uptime Monitoring

For marketing and growth teams running campaigns on HubSpot, Snapshot Site turns a manual "let's check the landing page" habit into something automated.

Recent Articles

Subscribe to Snapshot Site API

Snapshot Site is a powerful API that allows you to capture full-page, high-resolution screenshots of any website with pixel-perfect accuracy.
Simply send a URL to the API to generate a complete snapshot — not just the visible area — covering entire web pages, scrolling content, landing pages, blogs, news articles, social media posts, videos, and more.
Designed for developers, designers, marketers, and journalists,
Snapshot Site makes it easy to integrate web page capture into your applications, workflows, and automation tools.

Subscribe Now
bg wave