Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Form capture from a WordPress site

Posted on by 210

I'm trying to make use of the Form Capture functionality from the Dynamics Marketing module for our simple WordPress-based site. I've managed to insert the relevant <script> and <div> tags into the page dynamically (i.e. they are added by WordPress on the fly  using the "Inseart Headers and Footers" addon). It's CRUCIAL that those are added dynamically, as the same WordPress site is handling two language versions, and depending on which URL is used a different page is shown along with different tracking scripts.

Alas, despite the correct <div> and <script> tags being on the final page, when I attempted to use the "form capture" feature I got the error:

"The target page doesn't include the required website tracking script. Please correct this and try again."

I suspect the feature only opens the HTML and checks if the relevant sections are there and doesn't actually run any JS that might be on the form. If that's the case, then do I need to rework my existing solution to use the underlying PHP to insert page elements server-side or is there perhaps another workaround?

*This post is locked for comments

  • Gamerseo Profile Picture
    Gamerseo 45 on at
    RE: Form capture from a WordPress site

    We were looking for solutions to this problem. Thanks for the helpful post

  • Zenmarc Profile Picture
    Zenmarc 25 on at
    RE: Form capture from a WordPress site

    Creating a lead form is easy, but creating one that actually converts can be tricky for some people. It isn’t hard. Lead capture form templates are an easy way to get up and running in no time. You can use the WordPress file manager plugin to make it easier and manage the files flow easily.

  • BonScott1 Profile Picture
    BonScott1 5 on at
    RE: Form capture from a WordPress site

    Hello everyone, while the post is being discussed, I would like to tell my story about how I started making my sites, maybe someone will be interested. In the beginning, my friend searched on Google how to use WordPress correctly and create websites in general, well, he seems to me very lucky, he came across people who teach through the zoom program. Well, gradually he began to study the creation of a website, and even the use of plugins such as video conferencing wordpress plugin. Well, of course, I also immediately picked up the idea of ​​creating websites, and went to the same people as he did. Now I make functional websites with nice designs and I like it :)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Form capture from a WordPress site

    Hi Alex,

    I've followed the same method as mentioned above and I have embedded a form on my website successfully.

    When I embed the form however, the 'Phone Number' field always appears differently than the others. I have tried using multiple different forms and creating my own fields but it still appears distorted.

  • MateuszBender Profile Picture
    MateuszBender 210 on at
    RE: Form capture from a WordPress site

    Yes... and no. There's an added benefit to doing these things in PHP; a while back I needed to confirm our domain name for Google Analytics / campaigns, and I also couldn't use the GA code to verify the page - likely for the same reason (i.e. code injected by JS client-side), so there are definitely reasons to use the the back-end for these things. It's absolutely no deal-breaker (we confirmed the domain using a TXT DNS entry) - so if someone wants to stick to JS code, that's still doable. Just putting it out there.

  • Suggested answer
    MateuszBender Profile Picture
    MateuszBender 210 on at
    RE: Form capture from a WordPress site

    I've managed to resolve the issue by utilizing server-side PHP to generate the required sections, rather than JS.

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Form capture from a WordPress site

    Hi Mateusz,

    The external form is controlled by generated javascript from CRM, the issue might be that you embbed form code was mixed with PHP controller code,

    you should firstly copy Javascript code and Form capture code from you Marketing Website record and then scan you website again in capture type marketing form.

    However, you could instead try form hosting type marketing form, just copy whole code in Form page record and add you site to whitelist rule, it's easier than form capture and I've found no difference compared with the capture form.

    27001.JPG

    I made a success embedded form in my wordpress site.

    I recommend you try Insert Html Snippet plugin for your wp, you can insert HTML code directly into your page/post block when edit the content so it's separate completely with PHP code.

    https://wordpress.org/plugins/insert-html-snippet/

     27002.JPG

    Below is my wp page with embedded form:

    https://joster.cloudaccess.host/?page_id=7

    27003.JPG

    Submission in Insights:

     27004.JPG

    Hope it helps.

     

    Regards,

    Alex

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans