How to Use the Copy Code Feature in Sparkforge Countdown Timers
Copy Code gives you an HTML snippet for embedding a Sparkforge countdown timer on non-Sparkforge sites or in third-party emails. Dynamic timers need a real startDate and a per-recipient uniqueID.
The Copy Code feature outputs an embeddable HTML snippet for a Sparkforge countdown timer. Use it when the timer needs to live somewhere outside Sparkforge.
When to use Copy Code
On non-Sparkforge websites
Paste the snippet into your site's HTML to show a timer on a landing page, blog, or external builder. Useful for time-sensitive offers, event countdowns, and product launches.
In non-Sparkforge emails
If you're sending from a third-party platform like Mailchimp or HubSpot, paste the snippet into the email's HTML so recipients see the countdown directly in the message.
Timer types in Copy Code
- Fixed: ends at one specific time. Requires
endDate. - Recurring: counts down, resets, counts again. Requires
startDate, duration, and loop count. - Dynamic: personalized deadline per recipient. Requires
uniqueIDand a duration;startDateis set when the recipient activates it.
Do I need to edit the code?
| Where it lives | Edit startDate? | Edit uniqueID? | Notes |
|---|---|---|---|
| Website or landing page (any builder) | No — paste as-is | Optional | All visitors see the same wall-clock deadline. |
| Static email (one deadline for everyone) | Yes — replace placeholder with the moment the email is sent (e.g., 2025-01-01T15:30:00Z) | Delete or ignore | Same deadline for all recipients. |
| Dynamic email in Sparkforge | Yes — use merge field {{right_now.date_time_iso}} | Leave default {{contact.id}} or swap for another contact field | Sparkforge fills merge tags at send time, giving each contact a personal clock. |
| Dynamic email in another platform (Mailchimp, HubSpot) | Yes — use that platform's current-datetime merge tag | Use that platform's per-recipient ID tag | Each platform names its merge tags differently. |
Key concepts
- Static timer: one deadline shared by everyone.
- Dynamic timer: deadline calculated per recipient — needs a personal
startDateand a personaluniqueID. - startDate is the stopwatch trigger. If the builder can't auto-calculate "now," you have to tell the timer when "now" is.
- uniqueID is the stopwatch serial number. Without it, every recipient sees the same cached image.
How to use Copy Code
- Create the timer. Set end date, appearance, and time format.
- Click Copy Code.
- Choose destination and alignment (email or website).
- For dynamic timers, replace
contact.idinside the curly braces with the relevant unique identifier (e.g.,contact.no) — for exampleuniqueID={{contact.no}}. - Set the correct sender time. The startDate field is required for code-snippet blocks. For external emails, replace it with the date the email was sent (e.g.,
startDate=2025-01-01T15:30:00Z). For dynamic timers in Sparkforge emails, replace it with{{right_now.date_time_iso}}.
Troubleshooting
- Timer never starts. Check that
startDatehas a real ISO date or a valid merge tag. - Everyone sees the same time. The
uniqueIDneeds to vary per recipient — use a merge tag, not a hardcoded value. - Wrong timezone. Confirm the date ends with
Z(UTC) or includes a timezone offset like-05:00.
Frequently Asked Questions
Do I need to edit the code when embedding inside a Sparkforge website?
No. The default snippet works because the deadline is shared by all visitors.
Is the unique ID really optional?
Only for static timers. Dynamic timers need a per-recipient uniqueID, otherwise everyone sees the same cached image.
Can I test a dynamic email timer before sending?
Yes. Send a test to yourself — merge tags populate with your own contact data, so you see what real recipients will see.
Does Copy Code work inside Sparkforge's email and site builders?
You don't need it. Inside Sparkforge builders you can embed the timer directly. Copy Code is for code-snippet elements or external platforms.
Was this article helpful?
Thanks for the feedback.