Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Personalized page content

Posted on by 570

Hi Everyone,

I was following the documentation on https://docs.microsoft.com/en-gb/dynamics365/marketing/personalized-page-content and I read throught the existing thread on the subject but still can't get my head around it.

I simply want to display this message on a marketing page: Hi FirstName by calling the value of my variable. 

I copied the JavaScript in the header as specified in the documentation but I don't understand how I can retrieve the var to display in the HTML.  

Any help will be appreciated

  • Samuel Boulanger Profile Picture
    Samuel Boulanger 570 on at
    RE: Personalized page content

    Hi Nya 

    Thank you for your answer. I already looked at the tutorials but I still don't get how to call the variable in the html.

    The code provided in the examples is the JS we need to add in the header from my understanding.

    I only need to call the var firstname in the HTML. The example which includes the HTML is for an alert and far too complicated for what I want to achieve.

    I added this JS in the header:

    <script>window.msdyncrm_personalizedpage = {
    id:"560dd91e-a774-ec11-8943-002248210888",
    success: function(data) {
    var firstname = data.Data["firstname"];
    result.innerHTML = "Hi" + firstname;
    },
    error: function() {
    alert("failed!");
    }
    };
    </script>

    What will be the next step?

    Thank you.

  • Suggested answer
    Nya Profile Picture
    Nya 29,056 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans