4 Replies Latest reply on Apr 16, 2018 7:43 AM by Bob #2245

    Dynamic content based on query string value

    Brianna Young

      Here's the scenario:

       

      I have one landing page for a special offer. This offer is valid for seven different brands. On that landing page, I am using dynamic content to display the logo of the brand by looking at the value of the brand field that's on the contact record. This works fine when clicking through from an email. The logo displays correctly.

       

      However, I need to use this same landing page in another place where the user won't be clicking through an email (a banner within the user's account). This account system, which is outside of Eloqua, will be appending the user's unique ID to a query string parameter. In the past, I've captured the unique ID and used Javascript and a Web Data Lookup and then displayed a CDO field based on that unique ID (a promo code, for example). I can't figure out a way to display the dynamic content for the logo. Is this even possible, or are we limited to only personalizing the text in this way?

       

      Since each piece of dynamic content has an ID associated with it, is it possible to insert that ID somehow? And if I do that, will the dynamic content rules still evaluate and show the correct logo based on the brand that's on the contact record?

       

      Is this as clear as mud?

        • 1. Re: Dynamic content based on query string value
          Bob #2245

          If I get what you're trying to do correctly, you can do exactly what you did in the past. Except you don't have to use Dynamic Content. Here's the gist of it:

           

          • put the logo's URL in an Eloqua field (I assume a CDO field works best for you as its related to a specific offer and not a contact)
          • Using JS/WDL and the User ID, look up the Eloqua Contact Record and grab the value from that specific field
          • Now use JS to paste the value into the page's HTML code of the image, i.e. <img src = "yourvaluehere">
          • Have a fallback url to show a general image in case no User ID is passed

           

          I think this should work. Does this help?

          • 2. Re: Dynamic content based on query string value
            Brianna Young

            That does help, thank you! I wasn't sure if I could put an entire image URL into a field. I'll give this a try and report back. Thank you!!

            • 3. Re: Dynamic content based on query string value
              Brianna Young

              Hi Bob - I think I'm getting closer, but I'm getting stuck on how to use JS to paste the value into the page's HTML code. My Javascript knowledge is limited, so I may need to get outside help. When we did this previously, we were just inserting text from a field onto the page. Is there a simple code snippet for doing this, or would I be better off seeking a JS expert to do this?

               

              Thanks again for your help!

              • 4. Re: Dynamic content based on query string value
                Bob #2245

                Hi Brianna,

                 

                I wish I could help you, but my JS knowledge is also limited. In this case, to the extent that I'm fairly confident that what I describe is possible with JS, I just don't know how to write it into a script. I don't think it's a very complex piece of JS, but hey, if one doesn't know how to write it, it might as well be Conceptually, the whole JS / WDL script would do the following in order:

                • Parse the page URL for the contact's ID
                • Use the contact's ID to look up the image URL from that contact's related CDO in Eloqua
                • Save that image URL to a variable
                • Search the page's HTML for an image with a certain class or ID
                • Replace that image's src attribute value with the URL stored in the variable