web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Form capture from a WordPress site

(0) ShareShare
ReportReport
Posted on by 216

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

I have the same question (0)
  • LeoAlt Profile Picture
    16,331 Moderator on at

    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

  • Suggested answer
    MateuszBender Profile Picture
    216 on at

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

  • MateuszBender Profile Picture
    216 on at

    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.

  • Community Member Profile Picture
    on at

    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.

  • BonScott1 Profile Picture
    5 on at

    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 :)

  • Zenmarc Profile Picture
    25 on at

    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.

  • Gamerseo Profile Picture
    45 on at

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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans