Giter Club home page Giter Club logo

cxense-4-wordpress's Introduction

cXense 4 WordPress

WordPress plugin that integrates your website with cXense.

In short:

  • Pings cXense crawler when a post is added/updated/removed
  • Adds content profiling meta tags (open graph) to the header of the HTML document
  • Adds cXense Analytics javascript to wp_footer
  • (wip) Replaces WordPress public search with cXense site search
  • (wip) Makes it possible to display recommendation widgets provided by cXense

Installation

  1. Clone this project in the plugin directory of WordPress.
  2. Install the plugin in wp-admin.
  3. Let the plugin know your site id at cXense. You can do this either by setting a constant with the name CXENSE_SITE_ID in wp-config, or use the settings page for the plugin that can be found in wp-admin, below Settings.

Optional configuration

The following constants can be used to modify the behaviour of this plugin. Define them in wp-config.php or in the file functions.php located in your theme directory.

Notice! None of these constants are mandatory. You can choose to define them in the cXense settings page that can be found in wp-admin. If you choose to define these settings in form of constants you can override them using the settings page.

CXENSE_USER_NAME and CXENSE_API_KEY API user credentials at cXense, used to ping the cXense crawler when a post is created/updated/removed. These constants will speed up the re-indexing of your website when content is changed.

CXENSE_GENERATE_OG_TAGS Boolean, whether or not this plugin should generate open-graph tags (default true).

CXENSE_DEFAULT_SITE_DESC A description of your website that will be used as og:description when no other description is available.

CXENSE_DEFAULT_OG_IMAGE URL to the image that should be used as og:image when no other image is available.

CXSENSE_ANALYTICS Boolean, whether or not to include the analytics script (default true).

CXENSE_USER_PRODUCTS Only necessary if you're using the WordPress plugin paygate. This constant makes it possible to send which type of product your visitor has to cXense as a custom parameter. The constants should contain a comma separated string with product names.

CXENSE_RECOMMENDABLE_POST_TYPES By default only posts with post type "post" will get recommended by the recommendations widgets provided by cXense. Use this constant if you want to define which post types that should be recommendable.

Actions and filters

cxense_is_recommendable — Whether or not current URL should be recommendable (strings 'true' or 'false'). Use this filter if you don't want certain posts to be recommended by the recommendations widgets provided by cXense.

cxense_og_url — Filters the current url that is used as og:url.

Registering page-views programmatically

After that the jQuery event cXenseInit has triggered you'll get access to the function sendCxenseEvent. Use this function to trigger pageViews at cXense programmatically.

sendCxenseEvent(extraCustomParams, extraUserProfileParams, path);

[extraCustomParams]:Object — If you want to add custom parameters

[extraUserProfileParams]:Object — If you want to add user profile parameters

[path]:String — By defining this argument the pageview will be triggered for a made up URL. This URL will not contain any content and therefor not affect the content profile nor user profile.

// Trigger a new page view for current page, with an extra custom parameter
sendCxenseEvent({ajax: 'yes'});

// Trigger a pageview for a made up page
sendCxenseEvent({ajax: 'yes'}, {subscriber:'yes'}, '/subscriber_912_settings');

cxense-4-wordpress's People

Contributors

victorjonsson avatar tombrannstrom avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.