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
    • Post code
    • 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

Add an MPP fallback image to your weather forecast

Fallback content allows you to show alternative content to recipients who have opted into Apple Mail Protection Privacy while still delivering your Litmus Personalize experience to all other iOS users. Use your finished weather forecast campaign in a rule builder mailing. Select Create a new tag in your mailing and then choose Rule Builder with the light green return arrows icon. Add a description for your rule builder tag in the modal that appears.

Define your rules in the Rule Flow modal. Rules will be implemented in the order they are entered in the flow. For the first rule, select the Condition link on the left under the If section.

rule flow modal with condition link of first rule indicated

In the Condition Editor dropdown, find Privacy Protection under the Device category. The condition dropdown to the right will automatically change to show Enabled. Save your IF condition, and choose the Edit action link under the THEN side on the right.

edit action link in rule flow modal

In the Action Editor, select Image from the display options, then use the Next button to continue. Choose an image to upload that you want as your fallback. In our example, we're using a 600 x 1 pixel transparent image to collapse the space where the weather forecast would otherwise appear. Enter the required URL for your fallback image and Save your action.

With your Privacy Protection rule enabled, you can add a final rule to display your weather forecast to all other users. Select the Edit rule link on the right under the THEN side.

In this Action Editor, select the Weather Targeter radio button and Next in the lower right corner.

All your available weather forecasts will appear in a scrollable library. Select the active weather forecast campaign for your email and Save with the button in the lower right corner.

You'll see your completed rule flow appear. If you need to make changes, you can edit any of the areas you'd like. Otherwise, choose Next and your new tag will generate. Add this code to your email wherever you want your weather forecast or your alternate image to appear for every subscriber!

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.

<a href="https://img.ltms.app/clickimgdfweather.ashx?c=10147.X76j1uJj1wKEvwBlxuvI"><img src="https://img.ltms.app/imgdfweather.png?c=10147.X76j1uJj1wKEvwBlxuvI&&cu=en-GB" border="0" /></a>

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.

Post code

Forecast setting option selected radio button Post code

Your content will feed two specific parameters: &cc (country code) and &pc (postal code). Find your desired country from the ISO country codes. The post code should be in the appropriate format for your specified country. You may use any country and matching post code in your weather forecast!

NOTE: For US post codes, the parameter requires a 5-digit zip code. If your current data includes ZIP+4 codes, you will need to include a 5-digit source to use with the Post code tag option.

<a href="https://img.ltms.app/clickimgdfweather.ashx?c=10199.ICI2puxMMokqRx1nrzV4"><img src="https://img.ltms.app/imgdfweather.png?c=10199.ICI2puxMMokqRx1nrzV4&&cc=%%MERGE-COUNTRY%%&pc=%%MERGE-POST-CODE%%&cu=en-GB" border="0" /></a>

City

Forecast setting option selected radio button City

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.

<a href="https://img.ltms.app/clickimgdfweather.ashx?c=10147.X76j1uJj1wKEvwBlxuvI"><img src="https://img.ltms.app/imgdfweather.png?c=10147.X76j1uJj1wKEvwBlxuvI&&cc=%%Merge-Country%%&cn=%%Merge-City%%&cu=en-GB" border="0" /></a>

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.

<a href="https://img.ltms.app/clickimgdfweather.ashx?c=10147.X76j1uJj1wKEvwBlxuvI"><img src="https://img.ltms.app/imgdfweather.png?c=10147.X76j1uJj1wKEvwBlxuvI&&cc=GB&cn=LONDON&cu=en-GB" border="0" /></a>

Airport code

Forecast setting option selected radio button 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.

<a href="https://img.ltms.app/clickimgdfweather.ashx?c=10147.X76j1uJj1wKEvwBlxuvI"><img src="https://img.ltms.app/imgdfweather.png?c=10147.X76j1uJj1wKEvwBlxuvI&&ac=%%Merge-IATA-code%%&cu=en-GB" border="0" /></a>

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.

<a href="https://img.ltms.app/clickimgdfweather.ashx?c=10147.X76j1uJj1wKEvwBlxuvI"><img src="https://img.ltms.app/imgdfweather.png?c=10147.X76j1uJj1wKEvwBlxuvI&&cu=en-GB" border="0" /></a>

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:

&sd=YYYYMMDD 

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

<a href="https://img.ltms.app/clickimgdfweather.ashx?c=10147.X76j1uJj1wKEvwBlxuvI"><img src="https://img.ltms.app/imgdfweather.png?c=10147.X76j1uJj1wKEvwBlxuvI&&cu=en-GB&sd=20230815" border="0" /></a>

browser result showing weather forecast with appended start date

Top

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