Showing posts with label Flash. Show all posts
Showing posts with label Flash. Show all posts

Thursday, March 25, 2010

Personalizing Flash with Eloqua Data


(Guest post by Pancheliyan Pancras)

===================

After my last post on creating a web form in Flash© and integrating it with Eloqua, there has been a lot of interest in how to pass personalization data into a Flash file. There are several different methods of doing this. Today I will be covering a fairly basic method that utilizes the ‘FlashVars’ property. This method allows you to import variables directly into your Flash movie. Using this in combination with Eloqua PURL pages you can really create dynamic and unique Flash content for your web site visitors. There are two parts in implementing this using Eloqua.

First, we will need to create our Flash file. I will be using Action Script© 3.0 for this example. Before we even dive into the coding we must plan ahead to determine which fields we will be using. In this example we will be working with First Name, Last Name and Email address. Please see the sample Action Script code below for what to call the parameters and how to insert them into the dynamic text fields within the animation.

(click on the image for a larger version)


• Line 1: Declare an object using the LoaderInfo class to enumerate all the parameters we are passing from the PURL page

• Line 3: Declare a string called ‘first_name’ to the first parameter called firstname (variable within the FlashVars found on the PURL page)

• Line 4: Declare a string called ‘last_name’ to the first parameter called lastname (variable within the FlashVars found on the PURL page)

• Line 6: We are simply concatenating first name and last name with an exclamation. Just so it looks better when we present it using the Flash animation

• Line 8: Another way of directly passing the parameter to a dynamic text field

Now that the Flash file is ready to accept parameters, we will need to create a new PURL page to host our dynamic content. As mentioned previously we will be using the property called ‘FlashVars’ which almost looks like a regular query string in a URL. Each parameter will be separated by an ‘&’ symbol. Note that URL escape codes will work as well (if you want to add any spaces, symbols etc...).

To insert Flash into a web page we use the object element to embed the animation. This is also where we are going to use the power of Eloqua Field Merges to pass the parameters. Please refer to Eloqua’s Customer Central (which is now open for everyone) for helpful user guides on creating PURL pages and inserting Field Merges.

Within the object we will need to add a line using PARAM to set the value. This is where we call 3 Eloqua field merges (highlighted in yellow) to provide us the information from the contact record. These fields are populated dynamically based on your PURL record. If you are hosting this page on your own website you will need to use Data lookups to pre-populate these fields.

(click on the image for a larger version)


Then we will need to call the 3 field merges again within the embed tag.

(click on the image for a larger version)


So for our example above, our final code and result would look like this.

(click on the image for a larger version)





The above example is a simple illustration of what can be done with Eloqua PURL pages and Flash, but using these tools marketers can get really creative to deliver exciting content to their clients.

Tuesday, February 23, 2010

Using Flash to submit an Eloqua Form


Today's guest post is from Cheliyan Pancras, an Eloqua Product Specialist who joined us recently from the University of Windsor's computer science program. In this post, Cheliyan uses some of that background in showing how to integrate an Eloqua web form within an Adobe Flash element.

======================================



Flash is a great way to engage with website visitors, but far too often it is treated as separate from demand generation marketing efforts. Often, marketers even think it may not be possible to engage with web visitors using a form within a Flash element. Not true. Why not embed a short form at the end of the Flash video and submit it to Eloqua? For example you could ask your web site visitors to subscribe to upcoming updates on a new product/service at the end of a teaser video… The easiest way to build this is in Flash to use the method GET to send the web form data. You will be using the function called getURL (link to definition on Adobe). This is ideal for a short form.

First you will need to create a new form or use an existing web form. Within the form you will need to setup the processing steps to handle the incoming data. I would also create a new confirmation page tailored to your Flash video for a smoother transition after the data has been submitted. You can find great users guides on how to create forms and set up confirmation pages on our customer portal (Eloqua’s Customer Central).

There are two mandatory hidden fields, elqFormName and elqSiteID, which are used to identify the form and the instance of Eloqua you are submitting to. Once you create a Form in Eloqua you can retrieve this information by going into the ‘Form Details’ area and clicking on the ‘Integration Details’ button. The ‘Website Integration Details’ will give you the address to post the data to and the form identification values - using a similar technique to how we found form details for setting up hidden form submits or for integrating web forms into PDFs.



In our example below we are using Adobe Flash CS4 © (ActionScript 2.0). The screenshot shows you a simple form with 3 text inputs and a submit button. The input fields include First Name (c_firstname), Last Name (c_lastname) and Email Address (c_emailaddress).




Now that you have a layout created and the fields labeled, you must get into the actual code to setup the URL. To do this you need to go into the Flash Action and start by creating an event handler for when the button is released. Right click the submit button and select ‘Actions’ to bring up your ActionScript window.

Start by using the event handler ‘on(release)’. This will execute the getURL function when the button is pressed and released. The screenshot shows you the code within Flash for the short form. The description of each line item can be found below the screenshot.



• Line 4: Declare variable for hidden form field elqFormName
• Line 5: Declare variable for hidden form field elqSiteID
• Line 6: Declare input text field c_emailaddress. The Eloqua form is expecting this text input as c_email.
• Line 7: Declare input text field c_firstname. The Eloqua form is expecting this text input as c_fname.
• Line 8: Declare input text field c_lastname. The Eloqua form is expecting this text input as c_lname.
• Line 10: getURL function which has the URL to post the data to, the window parameter (to specify the HTML frame to load the URL) and which method to use to send the data (GET).

Note: In our example above we used the ‘_blank’ parameter to load the URL in a new window. Your other options are ‘_self’, ‘_parent’ or ‘_top’. You can find what each of these parameters do in the definition link at the beginning of this post.

That’s it! Now you can use this Flash video to submit data to your Eloqua form. You can test the sample I discussed below. The form will open a new window and confirm your submission. Then redirect you back to the blog.