Skip to content

Wordpress Integration

Requirements

This setup assumes you have already setup your App Key on the Dashboard

Integration Steps

STEP 1. If you don't have already, get a Custom Javascript plugin for your Wordpress installation

Plugin Search

STEP 2. Referring to the WebSDK Integration copy paste the code and replace the app_key for your App.

STEP 3. To identify users by name you may want to alter the script to get the Wordpress "username" and set that as the Contextual user_id.

Setting user_id

Your Javascript should not look like the snippet above. Here is the snippet to cut-paste:

1
2
3
4
5
6
7
Contextual.ready(function() {
    Contextual.register(APP_KEY, USER_ID).then(function(){
      if (jQuery(".username").text()) {
        Contextual.tag.string("user_id",jQuery(".username").text());
      }
    });
});

STEP 4. Login to Wordpress on another browser tab and reload the page.

STEP 5. Go to https://dashboard.contextu.al/users and sorting by "Last Seen" you should see your name in the identifier column.


Last update: 2023-11-22