Discussions

Bringing Weather Data into an Eloqua Campaign

roy at keelaro dot com
roy at keelaro dot com Posts: 85 Blue Ribbon
edited Apr 29, 2022 6:22AM in Eloqua

Here is my solution to adding weather data to an Eloqua Campaign.

Business Requirement: Provide a local forecast for Customer Roadshows/Events and include that in the reminder email sent to registered contacts.

Overview: An external weather data API is used to pull the forecast information for a specific location(s) and a date range. The weather data is processed and either a "HTML Code Snippet" can be uploaded to Eloqua as "shared content" and or the data can populate a Custom Object. Whichever route is chosen the content can be dynamically merged into the reminder message based on the location of the Roadshow.

Email or Landing Page: The content is rendered using open source "Weather Fonts" and CSS. These can be replaced, juy like any HTML content with other designs and styles to suit branding guidelines. Typically a 5 day forecast is rendered like this: (Note: ignore the tabs, Raw, Weather CSS, HTML Snippet, Eloqua CDO, CSV as these are just from my development environment)

Screenshot 2019-09-20 at 17.41.19.png

Weather Data API response: One thing that comes to light when you start to include weather data in your campaigns is that it has a very sshort shelf life. The weather forecast changes frequently , so you have to consider the age of the stored data. Weather data isn't free (ie there are license fees to pay, based on usage) so you want to store the data you have received and only update what you need to. An API response typically looks like this.

Screenshot 2019-09-20 at 17.42.53.png

Notice that <current_conditions> is one node and there are 5 other nodes all labelled <weather> and then within the <weather> node I have opened there are 8 nodesl abelled <hourly>. What this means is that the forecast is not a single value but a series of detailed values for the day and hour of day. If you visit any typical weather site you will see current conditions and then a breakdown by hour.

For your Eloqua Campaign forecast you have to calculate what the weather is most likely to be and represent that with a single icon e.g. from my example above Sunday is going to be wet, but that doesn't mean it will rain for 24 hours. If there was only one hour of rain and then 7 hours of Sunshine the display icon would be different.

Processing the weather data : The weather data can be processed and presented back to Eloqua in a number of ways.

A HTML Snippet (which can be used as shared content)

Screenshot 2019-09-20 at 17.41.32.png

or pushed into a Custom Object

Screenshot 2019-09-20 at 17.41.48.png

Typically weather data APIs are rich in content. My Custom Object includes the variables necessary to render "The Weather Forecast" above with one additional value which is the "Weather Code". This value allows for Custom icon mappings, so rather than being limited to one set of icons it can be used to replace the Weather Font with something else.

Campaign Execution: A step in the Campaign canvas shoud validate that the Custom Object data is current, if not then an outbound call from Eloqua to the Weather App will initiate an update to the Custom Object. Location data can be included in the outbound call, but be careful about using city/town names. There are a surprising number of duplicate name around the world. In the UK Postcode is working, however a tryely unique location can only be guaranteed if you use Long/Lat values.

Post edited by OIT Integration User on
Tagged:

Comments

  • Heather_vtm
    Heather_vtm Posts: 5 Red Ribbon

    Very cool - thanks for sharing!

  • bkhayes
    bkhayes Posts: 59 Silver Medal

    This is cool. You mention using an API. Would you be willing to share that process of how you are connecting the API to the CDO itself? Thank you!

  • This is cool. You mention using an API. Would you be willing to share that process of how you are connecting the API to the CDO itself? Thank you!

    To update data in a specific CDO you can follow the Oracle docs in the developer guide https://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAC/api-application-2.0-custom-object-data.html

    In general terms the process is as follows:

    1. App will create the body for an API call
    2. Secure Login to Eloqua
    3. Use the GET or PUT method (api/REST/2.0/data/customObject/{parentId}/instance/{id}) to write data. PUT if you are updating existing records
      1. {partentId} is the Custom Object, this obviously needs to exist or depending on your app sophisitication can be created.
      2. {id} is the specific Custom Object record. Note: The App needs some itelligence here, either a record of all locations already with records or a search to find if one exists.
        1. Like ?search=Location='SL4 4BA', which if found will return the record. On success you can process to a PUT (updating the existing record) or on failure to a GET (creating a new CDO record for the location)

    The actual connection is straightforward as it's just an Eloqua user account with API access and the published API endpoint for the action you want to execute. The real challenge is in the level of logic you want in an APP to handle, so that every User Story is implemented in an elegant way.