Testing Dynamic Content Using Test&Target Widget Offers

Want to see how everything connects together? Watch this freaking awesome video.

 

 

Want to know the details? Keep reading….

 
I recently was presented with an interesting problem: Return a chunk of content from a CMS based on the Offer that Test&Target served up to a visitor.
 
After doing a little digging in Test&Target online help, I discovered Widget Offers, which are defined as “similar to a standard offer hosted outside of Test&Target. They allow Test&Target to deploy offer content that’s stored on your server, allowing for more sophisticated and dynamic usage. Widget offers provide some dynamic content generation capabilities that other offers outside of Test&Target do not. If the mbox serving the offer contains mbox parameters such as mbox.offerId that is appended to the requested URL.”
 

This is perfect!!!

 
Not so fast. The solution seems a perfect fit but the documentation left a ton of holes in how to actually get a Widget Offer to work. So, I hope my 5+ hours of banging my head against the desk, digging for secret information, and trial & error, will help save you the headache and give you a jump start on utilizing Widget Offers to test dynamic content.
 

Here is the top secret stuff that you need to know:

 
→ Retrieve the Offer Id via a Test&Target Plugin
 
In order to expose the Offer Id, you will need to create a new Test&Target Plug-in using the following code.
 
[javascript]

[/javascript]
 

→ Offer Id mBox Parameter
 
The Offer Id Parameter name is not very clear in any of the online help but I have confirmed that the following format works:
“offerId=”+[OFFER_ID]

→ Pass in Offer Id via mboxUpdate
I originally tried to pass in the Offer Id on mboxCreate but this failed, which makes sense, the Offer Id isn’t available until after the mBox is created and evaluated, so you can use mboxUpdate to pass in the Offer Id.
 
[javascript]


[/javascript]
 
→ Widget File Must Contain a Defined Charset
 
This one really drove me crazy. I had everything working, the plug-in setup, the page code applied, my server side code humming, but when I tried to create the Widget Offer, everything came to a screeching halt. I pointed the offer to my server side file and every time I tried to save, I was presented with the following error:
 
The specified URL does not return valid text or HTML content. Verify the URL in your web browser.
 
Don’t ask me how but I finally discovered that if I simply defined a default Charset in my server side code, everything worked beauitfully. So take my advice, just add this one little line of code to the top of your file:
 
[javascript]

[/javascript]
 
→The Widget Offer Is Cached
 
The Widget Offer is cached for 2 hours, so if you are making changes to your widget file and aren’t seeing the changes take effect, clear your cache and try again.
 
 

Join the Conversation

1 Comment

  1. Great post and I commend you on your excellent dedication in figuring it out with the limited documentation that exists! Although I will say, oh man, if you ever have troubles like this again, please don’t hesitate to contact me for protips and code – there are a TON of helper plugins to assist advanced T&T applications!

Leave a comment

Your email address will not be published. Required fields are marked *