Thunder Docs
  1. Custom stores integration
  • Custom stores integration
    • Thunder Script Integration
    • Thunder Webhooks Integration
    • Orders Webhook
      POST
    • Products Webhook
      POST
  1. Custom stores integration

Thunder Script Integration

Thunder Script is a lightweight, asynchronous snippet (typically added in your site’s <head>) that collects visitor, source, and login attribution data in real time. By embedding a small JavaScript file.

Overview#

Thunder automatically tracks visitors from their very first page visit until they become customers.
It provides:
Visitor identification
Marketing attribution
Campaign tracking
Login attribution
Cross-session identification
Durable visitor IDs
Customer attribution for reporting
The script is lightweight, loads asynchronously, and has minimal impact on page performance.

Quick Start#

1. Install Thunder Script#

Add the following script inside the <head> of every page.

2. Identify Logged-in Customers#

After a successful login or if customer is already logged in, save the customer information in localStorage under the key user.

Field Specifications#

FieldTypeRequiredDescription
idString or NumberYesUnique customer identifier
emailStringRecommendedCustomer email address
mobileStringRecommendedCustomer phone number in international format

Data You Provide#

Thunder only requires customer information after login.
FieldRequired
idYes
emailRecommended
mobileRecommended
No additional API calls are necessary.

Verification#

Browser Storage#

Open Developer Tools → Application → Local Storage.
Verify that user exists after login.

Browser Support#

Thunder supports all modern browsers.
Chrome
Edge
Firefox
Safari
Mobile Safari
Chrome for Android

Privacy & Compliance#

Depending on your region, you may need to obtain user consent before enabling visitor tracking.
Examples include:
GDPR
CCPA
ePrivacy Directive
If required, initialize Thunder only after consent has been granted.

Sensitive Information#

Thunder does not collect:
Credit card numbers
Payment information
Passwords
Authentication tokens

Best Practices#

For the most accurate attribution:
Load Thunder inside <head>.
Store the customer immediately after login.
Use a permanent customer ID.
Keep customer emails consistent.
Use international phone numbers.
Avoid changing customer IDs.

Troubleshooting#

Login Event Not Sent#

Verify that:
localStorage.user exists
The value is valid JSON
The customer ID is present

Duplicate Customers#

Always use the same customer ID for the same customer.
Do not generate random IDs.

Script Not Loading#

Verify:
The script is inside <head>
The CDN URL is correct
Browser extensions are not blocking requests

FAQ#

Does Thunder affect page performance?#

No.
Thunder loads asynchronously and has minimal impact on page rendering.

Does Thunder work with Single Page Applications (SPA)?#

Yes.
Thunder supports modern frameworks such as:
Next.js
React
Vue
Angular

Can customer information be updated?#

Yes.
Simply overwrite the localStorage.user object.
Thunder automatically detects changes.

Next Steps#

Once Thunder Script is installed and customer identification is configured, you're ready to integrate thunder webhooks
For additional Information Contact Thunder Support team.
Modified at 2026-11-12 08:58:31
Next
Thunder Webhooks Integration
Built with