Implement Data Providers to integrate third-party data into ÃÛ¶¹ÊÓÆµ Target
Implementation details and examples of how to use ÃÛ¶¹ÊÓÆµ Target’s Data Providers feature to retrieve data from third-party data providers and pass it in the Target request.
at.js
1.3 or aboveImplement the Basic Components of Data Providers
A quick overview of the basic components of a dataProvider
and how to get your code in the right order.
A working example with the code used in the video can be found here:
Integrate with a Third-Party API
OK, so let’s take a look at a more realistic example that incorporates a third party API call to provide the information that we wanted to pass to Target. So we’re going to open up this second example. And now if you look at my Network tab you’ll see there are, there’s an additional request. And here we see this call to the weather API. That’s responding with all types of information about the weather. It’s raining here where I am and you’ll see that there is weather information that gets passed in the Target request. This weather condition parameter in this weather details parameter. So let’s take a look at the source code and see what’s going on here. So it’s very similar to our simple static example, at.js is the last thing we’re defining our Target Global settings calling-in this data provider called Weather Provider.
Weather Provider is up here and you’ll see there’s quite a bit more happening in that provider itself. One thing to notice, I’ve set a timeout here since it involves this third party request. The data providers will hold up the Target request for as long as your timeout setting. The default is two seconds. You can make that higher, you can make it lower and the Target request will wait until the provider comes back or this timeout is reached. At.js will manage Flicker while waiting for this third party call. So here I’m just I’m forcing in the latitude and longitude. So this isn’t going to show your local weather, it’s going to be the weather in the New York City area. But here here is where I’m making my request to the third party, making an Ajax Json request and you’ll see in the Success function here’s where my callback function is for the data provider. So again, in that first argument for the error we’re passing null again.
You’ll see in the area handling we are using that first parameter, the first argument of the function call. But then the meat of it I’m passing these two parameters in the Target request and I’m reading out these particular fields from my weather API response. So, this is again a more realistic example and you’ll see these dynamic parameter values end up in my Target request.
A more realistic example, integrating a weather API.
A working example with the code used in the video can be found here:
Integrate with Multiple Providers
How to incorporate data from multiple providers into your global Target request.
A working example with the code used in the video can be found here:
Minimize Page Load Impact
Minimize the impact on page load time by storing data in a session storage object. Alternatively, you could pass the values as profile parameters using the profile.
prefix, and just pass them in the first Target request of the session. However, you would be limited to passing fifty profile parameters per request.
A working example with the code used in the video can be found here: