Create a weather forecast campaign tag

Once your weather forecast template is complete, you can add it to a campaign weather forecast tag.

Create your campaign tag

In Campaigns, create a new campaign or use the edit icon for an existing one to add your new weather forecast tag.

litmus personalize campaigns tab window

Select New Campaign and name it, or use the pencil icon to add your template to an existing campaign. Use the plus sign icon to show the widget options menu, then select the weather widget yellow sun icon in the Contextual category.

Name your new mailing tag, then Next to select the weather tag option button Weather Forecasts. Use the Next button to continue. If you need to make a change, you can use the Previous button to return to the mailing name window.

Choose a template from your weather forecast options, then Next to continue.

choose a template with arrows at left and right to scroll through options, as well as thumbnails below to directly select a template

Enter a description for your tag and then the URL for your landing page in the Href data field. Use Add images to upload a fallback image. Select Start Upload or use the Start button by each individual image to make sure Litmus Personalize has your selections available for your mailing.

Your fallback image will be substituted for the weather forecast if the location cannot be determined. Alternatively, you can also use a 1x1 transparent gif to hide the forecast section in your email.

description, href for landing page and fallback image upload window for your weather forecast tag

Select your weather location and language options. These options can be customized after your campaign tag is generated.

  • Location options are
    • Location of open
    • City
    • Airport code
  • Language - select from dropdown

forecast location and language selection options

Select Next to generate your completed campaign tag code. You can copy it to your clipboard with the icon in the upper right corner of the code preview. Add it to your email or customize it by location, language, or date to meet your needs.

final generated tag with copy to clipboard icon showing

Test your weather forecast

You can test your code by copying the img src portion of the forecast tag and using it in your browser. Copy everything between the quotation marks to capture the full URL. You'll see the forecast result that will be served to your subscribers unless the fallback image is required due to their individual mail privacy settings.

weather forecast tag with img src URL portion highlighted

browser result showing weather forecast from img src URL

Customize location and language

Adding merge tags or editing parts of your tag allows you to provide the right weather forecast for every subscriber.

Location of open

This option automatically detects location when the subscriber opens your email and presents the weather forecast. If a subscriber has turned off or masked their location, the resulting forecast may not reflect their true location.


When you select the City option, you will need to edit the resulting campaign tag to include your ESP's merge codes in place of the defaults provided if you'd like to present your subscriber's weather.

personalize tag with highlighted merge code placeholders of %%merge-country%% and %%merge-city%% to replace with corresponding ESP merge parameter codes

If you wish to provide a forecast for a fixed location, edit your campaign tag to include ISO country codes (alpha 2) and the city name to specify the location.

personalize tag with placeholder %%merge-country%% and %%merge-city%% codes replaced manually with GB for country and London for city

Airport code

Include an airport code in your tag to provide weather at a particular destination. Replace the merge tag placeholder with an official airport code.

personalize tag with highlighted placeholder for airport code %%merge-iata-code%%

Language options

Create your tag in one language and then edit the language code parameter to provide different versions of the same campaign experience. Use ISO 639-1 designations to provide localization.

personalize tag with highlighted language parameter %%cu=en-GB. replace en-GB with any desired language code

Customize the start date for your weather forecast

You can set the start date for your forecast to begin up to 11 days from your send date. For example, if you send your campaign on August 4, you can append code to your tag for the forecast to display weather starting on August 15.

NOTE: If your appended date is farther in time than the current date plus 11, you may see incorrect dates appear in testing.

To append your weather forecast tag, locate the end of the img src tag before the final quotation mark. Do not leave a space and include the following:


where YYYY is the year, MM is the month, and DD is the date.

weather forecast tag example with appended date parameter code

browser result showing weather forecast with appended start date


Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us