Skip to content

feat: free credits on 5 years of keploy cta button inclusion#396

Open
amaan-bhati wants to merge 57 commits into
mainfrom
mql-component-0
Open

feat: free credits on 5 years of keploy cta button inclusion#396
amaan-bhati wants to merge 57 commits into
mainfrom
mql-component-0

Conversation

@amaan-bhati

@amaan-bhati amaan-bhati commented Jun 22, 2026

Copy link
Copy Markdown
Member

Adds an inline "5 Years of Keploy" promo banner to high-intent blog posts. The banner opens a lead capture modal that submits directly to the Keploy telemetry server. No Next.js API route, no MongoDB connection from the blog.


What this does

Inline banner + lead modal

  • A promo card is injected mid-article at a configured text anchor point per slug
  • Clicking "Get 1 Month Free" opens a modal with a form: name, email, company, designation
  • On submit, a reCAPTCHA v3 token is obtained and the payload is POSTed to https://telemetry.keploy.io/blog-mql
  • On success, a confirmation screen shows with an explicit "Open Keploy" link — the user chooses when to navigate, no automatic redirect

reCAPTCHA

  • Invisible reCAPTCHA v3, no user-facing challenge
  • Script loaded via Next.js <Script strategy="afterInteractive"> scoped to the banner component only, not globally
  • If NEXT_PUBLIC_RECAPTCHA_SITE_KEY is not set, the banner does not render at all (fail-closed). On production the key is set in Woodpecker secrets
  • Token obtained on submit with action "submit_lead", never on page load
  • Google attribution ("Protected by reCAPTCHA") shown in both the banner and near the submit button per ToS

Slug wiring
New slugs are configured in config/inline-promos.ts. Four CTAs are active across three pages on this branch:

Slug Injection point
software-testing-basics After first definition paragraph
api-testing-strategies Before "Contract Testing" section heading
software-testing-strategies After Automation Strategy section (first CTA)
software-testing-strategies After Performance and Security Testing section (second CTA)

How i decided where to place the cta buttons:

CTA buttons are placed based on research and anlytics, I've collated the reasoning and science behind each cta placement in a doc, that is for the Keploy team internally(you can only see this if you are a part of keploy, use keploy email to open the doc): https://docs.google.com/document/d/1rxk0ATlDR5zoNiGSMW0I8a7SFxE3-ttD4kIRDFDxOiY/edit?usp=sharing


Multi-promo injection
post-body.tsx was updated from a single-match boolean flag to a recursive applyPromos() function. It supports multiple CTAs per page and correctly handles cases where injection points are separated by code blocks (<pre> tags).


A few screenshots:

Screenshot 2026-06-26 at 8 39 14 PM
Screenshot 2026-06-26 at 8 39 36 PM
Screenshot 2026-06-26 at 8 39 49 PM
Screenshot 2026-06-26 at 8 39 59 PM
Screenshot 2026-06-26 at 8 40 07 PM

Files changed

  • components/InlinePromoCard.tsx - new component: banner, modal, form, recaptcha, submit logic
  • components/InlinePromoCard.module.css - deleted (badge suppression rule removed; selector cannot reach the badge injected by Google at document body level)
  • components/post-body.tsx - updated injection logic to support multiple promos per slug
  • config/inline-promos.ts - slug config and getInlinePromosForSlug lookup function
  • vercel.json - CSP connect-src updated to include https://telemetry.keploy.io, https://www.google.com and https://www.gstatic.com
  • .gitignore - added .claude/settings.local.json

How to add more slugs

  1. Add an entry to config/inline-promos.ts with the blogSlug, an afterText snippet from the post body, and promoId: "keploy-5years"
  2. If adding multiple entries for the same slug, they must be in document order in the array
  3. No other code changes needed

Environment variables

NEXT_PUBLIC_RECAPTCHA_SITE_KEY is already set in Woodpecker secrets and injected at build time. RECAPTCHA_SECRET_KEY is set on the telemetry server. No changes needed.

amaan-bhati and others added 2 commits June 19, 2026 20:41
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
@dhananjay6561
dhananjay6561 self-requested a review June 22, 2026 07:00

@dhananjay6561 dhananjay6561 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amaan-bhati LGTM upto now!

amaan-bhati and others added 12 commits June 22, 2026 13:39
Replaces the external CTA link with a modal form that collects
name, work email, company, and designation before redirecting.
Includes ESC-to-close, backdrop-click-to-close, scroll-lock,
focus-trap on first field, and a world-class UI that inherits
the warm amber/gold aesthetic of the inline banner.

Backend wiring is intentionally deferred — form onSubmit closes
the modal for now.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On form submit the modal now transitions to a confirmation view:
- Animated SVG checkmark (circle + tick drawn via stroke-dashoffset)
- "You're all set!" heading with 24-hour turnaround copy
- 3-second animated progress bar countdown
- Live "Redirecting in Xs..." text that ticks down
- Auto-closes and opens app.keploy.io/signin in a new tab after 3s
- Backdrop click disabled during confirmation to prevent accidental dismissal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…oy.io

Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
… repo

Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
@dhananjay6561
dhananjay6561 self-requested a review June 27, 2026 05:38

@dhananjay6561 dhananjay6561 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Reviewed all changed files. There are 4 blockers, 7 high-severity issues, and several medium/minor ones documented as inline comments below. The PR must not be merged in its current state.

Blockers:

  • mongodb added to package.json contradicts the PR description (no MongoDB connection) — either it is dead code or the PR is misrepresenting what it does
  • window.open called after await fetch will be blocked by popup blockers on virtually all modern browsers
  • Modal has no focus trap, no role="dialog", no aria-modal — screen reader and keyboard accessibility regression
  • "Full Name" field is visually marked required but has no required attribute

Comment thread package.json Outdated
Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/InlinePromoCard.tsx
Comment thread components/InlinePromoCard.tsx
Comment thread components/post-body.tsx Outdated
Comment thread components/post-body.tsx Outdated
Comment thread config/inline-promos.ts
Comment thread vercel.json

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.

Comment thread components/post-body.tsx Outdated
Comment thread components/post-body.tsx
Comment thread components/InlinePromoCard.tsx Outdated
Comment thread vercel.json
…non-promo posts

Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.

Comment thread components/post-body.tsx
Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/post-body.tsx
Comment thread components/post-body.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 3 comments.

Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/post-body.tsx
…cessibility

Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 3 comments.

Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/post-body.tsx Outdated
Comment thread components/InlinePromoCard.tsx
Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/InlinePromoCard.tsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Comment thread components/post-body.tsx
Comment thread components/InlinePromoCard.tsx Outdated
Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated 3 comments.

Comment thread components/InlinePromoCard.tsx Outdated
Comment thread components/post-body.tsx
Comment thread components/InlinePromoCard.tsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Merged GatedReport feature (new files: GatedReport.tsx, gated-reports.ts)
from main into this branch. Resolved post-body.tsx conflict by layering
gated report injection on top of the existing InlinePromoCard applyPromos
function — both features now work independently through a shared
processHtmlPart entry point. Also carries over perf optimisations:
parsedParts/renderedContent useMemo split, tooltipConfigs useMemo,
functional setState in handleCopyClick.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…f failure

Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants