Wordpress Contact Form 7

The Wordpress Contact Form 7 integration allows you to embed DataGuard CPM consent capture points into your Contact Form 7 forms. This enables seamless synchronisation of consent data collected via your WordPress forms with the DataGuard CPM platform. This integration requires minimal setup and involves pasting a code snippet into your form.

Prerequisites

Before you begin, ensure you have the following:

  • Access to the DataGuard CPM Platform.
  • WordPress installation with Contact Form 7 plugin active.

If you don't have access to the DataGuard CPM Platform, please contact us.

Integration Setup

To integrate DataGuard CPM with Contact Form 7, follow these simple steps:

Step 1: Paste the Code Snippet

  1. Open the WordPress admin panel and navigate to Contact > Contact Forms.
  2. Edit the form where you want to embed the DataGuard CPM consent capture.
  3. Add the following code snippet into the form code:
<div id="dataguard-widget"></div>
<p style="display: none">
    <script src="<scripts-url>/capture-point.min.js"></script>
    <script>
        window.addEventListener('load', () => {
            const widget = ExpressStatelessCapturePoint.load({
                id: 'dataguard-widget',
                templateId: '<template-id>',
                display: {
                    displayButtons: false,
                    location: 'inside',
                    consentricLogo: false,
                },
                contactDetails: {
                    verification: {
                        emailAddress: () => document.querySelector('[name="email"]').value,
                    },
                },
            });

            document
                .querySelector('.wpcf7')
                .addEventListener('wpcf7mailsent', widget.submit);
        });
    </script>
</p>

Step 2: Choose the Correct Script URL

Replace the <scripts-url> with the appropriate script URL. The URLs can be found on the Environments page.

Step 3: Replace the Template Id

Replace the <template-id> with the Template id for your DataGuard CPM widget. For details on how to set up your Template, please refer to the Template Setup page.

Additional Resources

For more information on how to customise and configure your DataGuard CPM widget, check out our Sign Up Widget page.

Conclusion

Your WordPress Contact Form 7 integration with DataGuard CPM is now complete. Any consents collected through your form will be synced with the DataGuard CPM platform automatically!