Newsletter Signup
Glopal takes your existing site as the source when deliverying localized sites. Glopal automatically adapts experience for the buyer, rewriting all links, translating text and localizing prices as required.
Any action that user does on the localized site (adding product to the wishlist or the cart, or signing up for the newsletter) will be processed as if user is doing the same action on your existing source site.
Sometimes you may want to capture localization context, eg. to recognize that user is visiting your Spanish localized site and process newsletter signup knowing that user should be added to the Spanish users newsletter group.
Glopal offers access to this localization context:
As HTTP headers for server-side customizations
As JavaScript global variable for JavaScript customization
Let us show two possible customizations to record country of the visitor for newsletter signup.
Client Side customization
Create additional (hidden) field for your newsletter form, that should produce HTML similar to:
Now using Glopal's JavaScript global variable we can automatically set hidden field value
Some form builders may allow defining dynamic value directly, in such case you can use glopal.config.target.countryCode
as dynamic JS value.
Server Side customization
If you have your own custom backend code that is receiving form submission, you can get country of the localized site from X-Glopal
HTTP headers, for example:
Last updated