WordPress Overlay Integration Guide

Modified on Mon, 12 May at 10:31 AM

Preface


This document provides a step-by-step guide to integrating the Newired Overlay into a WordPress application using a snippet. The approach follows the same principles as described in this article, but with specific adjustments for Salesforce’s extension system.


Prerequisites


Snippet


Prepare the Newired snippet. You can find the Newired Content URL in:

Newired Portal → Site → Deployment → Snippet text area.



 

Additional script


Script is needed to ensure Overlay initialization in WordPress environment.

<script onload="initializeCheck()">
function initializeCheck() {
if (typeof newired === 'undefined' || !newired.journeys) {
checkNewired();
}
}

function checkNewired() {
const interval = setInterval(() => {
if (typeof newired !== 'undefined' && !newired.journeys) {
newired.initialize();
clearInterval(interval);
}
}, 300);
}

initializeCheck()
</script>




Deployment


Prepare snippet. Replace <content URL> by your URL from deployment snippet.

<script id="newired-snippet" async src="<content URL>"
  onload="newired.initialize()">
</script>


<script onload="initializeCheck()">
function initializeCheck() {
    if (typeof newired === 'undefined' || !newired.journeys) {
        checkNewired();
    }
}

function checkNewired() {
    const interval = setInterval(() => {
        if (typeof newired !== 'undefined' && !newired.journeys) {
            newired.initialize();
            clearInterval(interval);
        }
    }, 300);
}

initializeCheck()
</script>


In WordPress administration locate Header and Footer setting.



Open setting and put snippet to section Before the </BODY> closing tag



Newired snippet should be the last, after other WordPress enha



Conclusion

By following these steps, you will successfully integrate the Newired Overlay into WordPress. For further troubleshooting, refer to the Newired Support Portal.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article