Content Marketing Metrics : Ways to measure the KPIs of your Content Efforts

Gone are the days when you would keep your intel guarded only to reveal it to the right prospect or to a frequent customer. Content Marketing lets you flaunt your industry specific knowledge in the form of content efforts directed towards a target audience. The ultimate aim of investing in a Content Marketing initiative is to come up with solutions that cater to your organizational goals. Once you have identified the objective for content creation/curation and delivered on the commitment to solve your audience’s pain points, what follows is the evaluation of your content’s performance.

The KPIs (Key Performance Indicators) for a Content Marketing initiative help you measure or rather evaluate the reach and impact of your content. The best content decisions are based on the information sourced from the feedback provided by the evaluation of relevant content metrics. Here we have a look at some of the major performance indicators that come in handy while measuring your content’s performance across the entire sales funnel.

Consumption Metrics : Know how your Content is being Consumed

When you repurpose your content in different formats to get traction on multiple channels, the focus of your efforts must lie on generating more page views and engaging unique visitors. Infographics, downloadable PDF files, expert interviews, whitepapers, infographics, videos and podcasts are content assets that are searched for and widely consumed by a web audience. While page view analytics lets you know the exact web-pages that are generating more web traffic, the unique visitor analytics gives you an idea about the visitors who return to your web properties for more engaging content.   

Then there is the Average time on page analytics that gives an insight into the number of people who are actively consuming your content. You can also study the browsing behaviour of your audience, that is if they are really reading through your article or just hopping across the web pages. If you want to identify the behaviour patterns and preferences of your audience, mining the analytics for the same would be the best way to get a hold of the kind of content that drives in the traffic.

Your content may be gated wherein it is locked behind a subscription/registration form. This helps you measure form completions and the frequency of registration forms being filled out with valid contact information. Meanwhile content assets that are indexed separately from a landing page become directly accessible from a browser’s search results, making it ungated.

Engagement Metrics: Engagement Rates for your Content Assets & Social Media Posts

Does your content engage your audience enough for them to pay heed to a call of action? Bounce rate, social shares, comments and the average time spent on the site are all indicators of the level of engagement you have with your readers. The feedback from your audience in the form of social media shares, clickthroughs for content sent via mail, comments and fan mail, clearly shows how engaged your audience is with your content. The more they want to connect with you through different social media platforms and communication channels, signifies the level of positivity they have for your content assets.

Google Analytics has a feature called Average session duration that lets you measure the "engagement hits" or the length of time a visitor spends on your site browsing through multiple pages.The sharing metrics let you identify the content pieces that are being actively shared along with the specific audience that is sharing it.  

Lead Generation Metrics : Generating Leads through Content Marketing

What defines the success of a content marketing campaign is the number of qualified leads that it generates during this “middle of the funnel activity”. There may be certain pieces of content that can be used in sync with a marketing automation tool to generate leads online. The qualified leads generated are then passed onto the sales team. According to Dharmesh Shah, CTO, Hubspot, the quality of leads generated through content efforts are much higher and the costs associated are minimal as opposed to lead generation through the paid channels.

An investment in content creation has become an indispensable part of the inbound marketing process as organizations today are increasingly deviating towards content marketing to pass on the messages to their audience. Google Analytics has a Goal Tracking option that lets you configure goals while tracking multiple conversion types with the help of metrics that helps you break them down based on their level of sales readiness.

Sales Metrics : How your content affects the bottom of the Funnel

You need to assign a context to the metrics for them to make sense. There is nothing like a combination of a well documented content strategy and some clearly measurable goals to spearhead a content marketing campaign. One of the best metrics to evaluate the content efforts are the sales metrics, as a content strategy is developed with the pivotal aim of driving sales success. The Sales Metrics help you measure the impact of your content on the sales pipeline. It lets you track how the consumption of your content influenced a content marketing campaign, ultimately leading to sales success.

Retention Metrics : Evaluating the levels of Audience Engagement

Retention Metrics let you track your content’s ability to hold onto your audience’s attention after an initial visit to your web properties. A comparison of the consumption and the retention metrics gives a clear indication of whether your content is effective enough in inspiring an audience to connect with your brand. It also tracks your web audience that keeps returning to your content, along with the frequency of these return visits and their willingness to subscribe to receive your content in future.

Operational Metrics: Metrics that really matter( Production and ROI)

A Report by Content Marketing Institute and  MarketingProfs indicates that a list of key challenges faced by Content Marketers include  a lack of time(69%), inadequate production of content(55%) and difficulty in generating engaging content(47%). Employee participation is a key operational metric which can be used in the early stages of a content marketing campaign to measure its rate of progress. The Production metrics provide an internal assessment of your content operations like adherence to editorial calendardeadlines and goals along with the performance of your content marketing team. Meanwhile the cost metrics help you in calculating the ROI for your content marketing efforts. It lets you assess the costs involved in producing, distributing and promoting the content assets like blog posts,whitepapers and newsletters etc.

While navigating through a content marketing journey you would have to track the KPIs to make sure that your content efforts are on the right track. KPIs are instrumental in letting you assess your current capabilities that include content generation skills, the ability to integrate third party tools and the use of advanced technologies to further a content marketing campaign in the right direction.

We at Valuebound keep a tab on the latest B2B content marketing trends and developments to provide you with Enterprise level web solutions to boost your digital marketing initiatives. For more information on our service offerings, please Contact Us.

How to use node api hooks in drupal 7

A hook is a PHP function that has a defined set of parameters and a specified result type. When you are implementing a hook in a module you are allowing it to interact with Drupal core. Drupal’s module system is based on the concept of hooks and the Node API in Drupal has a vast collection of hooks to help you work with nodes to add data or custom content. You can also extend node structures to include new fields or even establish new node types.

Underlying Concepts in Drupal API

The concepts in Drupal API are largely interdependent as one ceases to exist without the other. The Entity API is instrumental in creating lightweight and flexible Drupal solutions.

# Entity Type

The field system comes into play in Drupal 7 as you get to add fields to entity types like Nodes(content), Comment, User Profiles & Taxonomy Terms.

# Bundle

A subtype of an entity type, bundles are an implementation of the entity type to which you can attach the fields. But not all entity types have bundles, for instance Taxonomy does not have separate bundles(subtypes). Although many entity types do not allow bundles by default, you can still create bundles and with the help of the Field system add different fields to each bundle.

# Entity

An instance of a particular entity type like a taxonomy term or a bundle , you can load any entity using entity_load. The Entity API module lets you save or delete a function as there are options like entity_create(), entity_save(), entity_delete(), entity_view() and entity_access().

# Fields

A field is a primitive data type that can be added to entity types or bundles to help organize the content. It has custom validators and widgets for editing content and formatters to alter the display.

You can invoke several sets of hooks during the node operations based on the create, update, view and delete options. These hooks allow the modules to modify the base node operation and can be categorized into the following types :

# Node-type specific hooks
# All module hooks
# Field hooks
# Entity hooks

# Creating

  1. Function hook_node_presave
    You can invoke this hook from node_save() before the node is saved in the database. This hook is invoked when a node is being inserted or updated.
    /**
    *
    * Implements hook_node_presave()
    *
    * Create Page @ node/add/page, Page title will be saved with date extension.
    *
    * Act on a node being inserted or updated.
    *
    * This hook is invoked from node_save() before the node is saved to the
    * database.
    *
    * @param $node
    * The node that is being inserted or updated.
    *
    * @ingroup node_api_hooks
    */
    function hook_node_presave($node) {
      dpm($node);
      if ($node->type =='page' && $node->is_new) {
        // Alter title, add time stamp at the end of title:
        $node->title = $node->title.' '.date('M j Y h:i A');
        }
        // Remove $node->is_new to call at node updation time
    }
    
  2. Function hook_node_insert
    You can invoke this hook from node_save() after the database query meant to insert the node into the node table has been scheduled for execution. Before invoking this hook you will have to invoke type-specific hook_insert and call the field_attach_insert().

    You need to note that the write/update database queries executed from this hook are not committed immediately as you should not be relying on the data in the database when a transaction is still in process. If you want to trigger a mail or create any other event, you can use hook_node_insert for the same.

    /**
    *
    * Implements hook_node_insert()
    *
    * Act on a node being inserted.
    *
    *
    * @param $node
    * The node that is being inserted.
    *
    * @ingroup node_api_hooks
    */
    function node_api_node_insert($node) {
      dpm($node);
      if ($node->type =='page' && $node->is_new) {
        // after creating a new node the message is displayed with node id:
        drupal_set_message("Thanks for creating a page, your node id is" . $node->nid);
      }
      // Remove $node->is_new to call at node updation time
    }
    

# Updating

  1. Function hook_node_presave
    This hook acts on a node when it is being inserted or updated.  You can invoke the hook from  node_save() before saving the node to the database.
    /**
    *
    * Implements hook_node_presave()
    *
    * Create Page @ node/add/page, Page title will be saved with date extension.
    *
    * Act on a node being inserted or updated.
    *
    * This hook is invoked from node_save() before the node is saved to the
    * database.
    *
    * @param $node
    * The node that is being inserted or updated.
    *
    * @ingroup node_api_hooks
    */
    function node_api_node_presave($node) {
      dpm($node);
      if ($node->type =='page') {
        // Alter title, add time stamp at the end of title:
        $node->title = $node->title.' '.date('M j Y h:i A');
      }
      // Remove $node->is_new to call at node updation time
    }
    
  2. Function hook_node_update
    You can invoke this node from node_save() after invoking the type-specific hook_update() and calling the field_attach_update().
    /**
    *
    * Implements hook_node_update()
    *
    * Update Page @ node/nid/edit , Page title will be saved with  current date extension.
    *
    * Act on a node being inserted or updated.
    *
    * This hook is invoked from node_save() before the node is saved to the
    * database.
    *
    * @param $node
    * The node that is being updated.
    *
    * @ingroup node_api_hooks
    */
    function node_api_node_update($node) {
      dpm($node);
      if ($node->type =='page') {
        // Alter title, add time stamp at the end of title:
        $node->title = $node->title.' '.date('M j Y h:i A');
      }
      // In this node title with Updated date time extension 
    }
    

# View

  1. Function hook_node_view This hook acts on a node that is being assembled before being rendered.
    /**
    *
    * Implements hook_node_view()
    *
    * When View Page, Image style  will be change.
    *
    * Act on a node being viewed.
    *
    * @param $node
    * The node that is being view.
    *
    * @param $view_mode
    * The view mode of node.
    *
    * @param $langcode
    * The language of node.
    *
    * @ingroup node_api_hooks
    */
    function hook_node_view($node, $view_mode, $langcode) { 
      if($view_mode == 'teaser') {
    	$node->content['field_image'][0]['#image_style'] = 'demo_image';
      }
    
  2. Function hook_node_view_alter
    You can call this hook after assembling the content in a structured array. This hook may be useful to carry out the processing part that requires you to complete building the entire node content structure. You can add a post_render callback using this hook if you want a module to act on the rendered HTML of the node instead of a structured content array.
    /**
    *
    * Implements hook_node_view_alter()
    *
    * when view page altering the weight.
    *
    * Act on a node being viewed.
    *
    * @param &$build
    * The node that is being view.
    * @ingroup node_api_hooks
    */
    function hook_node_view_alter(&$build) { 
      if ($build ['#view_mode'] == 'full' && isset($build ['field_image'])) {
        // Change its weight.
        $build ['field_image']['#weight'] = -10;
      }
    

# Delete

Function hook_node_delete

This hook is invoked from node_delete_multiple() after you have invoked the type specific hook_delete(). You need to invoke this hook prior to calling hook_entity_date and field_attach_delete() and before you remove the node from the node table in the database.

/**
*
* Implements hook_node_delete()
*
* Act on a node being delete.
*
*
* @param $node
* The node that is being delete.
*
* @ingroup node_api_hooks
*/
function hook_node_delete($node) {
  // after deleting a node the message is displayed.
  drupal_set_message(“Node Deleted Successfully”);
}

# Prepare

Function hook_node_prepare

This hook acts on a node object about to be shown on the add/edit form. After you have invoked the type specific hook_prepare() you can follow it up by invoking this hook from the node_object_prepare().

/**
*
* Implements hook_node_prepare()
*
* when view page altering the weight.
*
* Act on a node being insert or update.
*
* @param $node
* The node that is being insert or update.
* @ingroup node_api_hooks
*/

function hook_node_prepare($node) {
  if (!isset($node->comment)) {
    $node->comment = variable_get("comment_$node->type", COMMENT_NODE_OPEN);
  }
}

# Validate

  1. Function hook_node_validate
    This hook performs node validation before the creation or updation of a node. It is invoked from node validate after you have finished editing the node before previewing or submitting it. The standard validation steps are followed by the invocation of the type specific hook_validate() after which the node_validate is invoked.
    /**
    *
    * Implements hook_node_validate()
    *
    * When node is being inserted.
    *
    * Act on a node being inserted.
    *
    * @param $node
    * The node that is being inserted.
    *
    * @param $form
    * The node form.
    *
    * @param $form_state
    * The node form_state.
    *
    * @ingroup node_api_hooks
    */
    function hook_node_validate($node, $form, &$form_state) {
      if (isset($node->field_date_end) && isset($node->field_date_start)) {
        if ($node->field_date_start > $node->field_date_end) {
          form_set_error('time', t('An event may not end before it starts.'));
        }
      }
    }
    /**
     *  Implements hook_node_load
    */
    function hook_node_load($nodes, $types) {
    global $user
    // check to see if the person viewing the node is the author, if not then hide the
    // annotation
    }
    
  2. Function hook_node_load
    This hook is used to add information that is not in the node/node revisions table. Although it adds information to the node object, it does not replace the information in the node tables which could interfere with the entity cache.
    /**
     *  Implements hook_node_load
    */
    function hook_node_load($nodes, $types) {
    global $user
    // check to see if the person viewing the node is the author, if not then hide the
    // annotation
     foreach ($nodes as $node) {
        if ($user->uid != $node->uid) {
           unset($node->article);
        }
     }
    

P.S.- In the examples above replace “hook’ with your module’s name.

Reference:
https://www.drupal.org/node/1261744
https://api.drupal.org/api/drupal/modules!node!node.api.php/group/node_api_hooks/7

A Step by Step Guide to Drupal 7 Custom Theme Development

A Drupal theme is a collection of files that provides a presentation layer for a Drupal website. In my opinion the user experience and the user interface when combined with theming are as important as the backend architecture. It does not mean only writing the style.css files with random HTML markups. You can create a basic theme for your website quite effortlessly as all you need is a .info file and a css file. The files can be added to the theme, based on your requirements to have a better control while executing what you want your end user to see.

Here I am sharing my first experience at creating a Drupal theme which I hope will be useful for budding web developers.

The Theme Folder Structure

The first thing that you should be aware of is the folder structure in Drupal 7. The core themes that come shipped with the Drupal installation are placed in the themes directory of root folder. It is advisable to place all the extra themes in sites/all/themes directory. Meanwhile it is a good practice to place all the downloaded themes called themes in a separate folder called along with the custom themes in a folder called custom.

This is what a typical folder structure will look like :

..
..
sites
..all
….themes
…...contrib
……..bluemarine
……..omega
…...custom
……..blue
……..blue_admin

Drupal theme structure explained

A basic pictorial representation of the Bartik theme.

Source: https://www.drupal.org/node/171194

Overview of Theme Files>

The files associated with creating a theme are a mix of “one” text file (that is the .info file), PHP script, Javascript and Cascading Style Sheet file i.e CSS file.

Of all these files, the one you require is the .info file which tells Drupal about your theme. Though a CSS file is also necessary without which theme will look like a bunch of black text and images thrown in a webpage. All the other files are to make the theme more gripping and to customize the UI according to the palette. Below is the list of files that a theme can contain:

  • .info — A required file which provides information about the theme.
  • html.tpl.php—It displays the basic html structure of a single Drupal page.
  • page.tpl.php — The main template that defines the content on most of the pages.
  • style.css — The CSS file that sets the CSS rules for the template.
  • node.tpl.php — This file defines the content of the nodes.
  • block.tpl.php — It defines the content in the blocks.
  • comment.tpl.php — It defines the content in the comments.
  • template.php—It can be used to hold preprocessors for generating variables before they are merged with the markup inside .tpl.php files.
  • theme-settings.php—You can modify the entire theme settings form.
  • logo.png — Your logo, if you are using one.
  • screenshot.png — This is a screenshot of your theme that is used in the admin panel and in the user account settings if you have enabled more than one theme so that visitors can choose which theme they want to use.

...And this is how we do it

Now that you have got some idea about the files,let’s get started by creating a basic theme with custom regions, a CSS3 slider and a superfish dropdown menu. I am going to walk you through the process step by step based on how I went about it the first time.

Step I : Creating the .info file

The .info file is a static text file wherein you can provide information about the theme and specify CSS and javascripts that you would like to include. You can also specify features and toggle settings although it is a completely optional. This is how a .info file will look like :

name = Blue
description = A Custom Drupal 7 Theme
core = 7.x
regions[header] = Header
regions[banner] = Banner
regions[content] = Content
regions[sidebar] = Sidebar
regions[footer] = Footer

You may note that only the name and core is needed while everything else is optional. So, create a text file, enter the above lines and save as YOUR_THEME_NAME.info. Now your theme will appear under the theme list. Enable and set default to use the theme.

Lets have a look at the layout of the theme.

Custom Drupal Theme

P.S. : You won’t get the exact same result as you have not applied any CSS to the regions.

Step II : Creating page.tpl file

page.tpl is all about how a drupal page would look and where and how do you want to render the contents and the regions.

This is how you get it started :

IFrame

As you can see in the code, I have printed by main-menu using php in the header. Make sure you have created your main menu and added links to it. You can also create some content and blocks and assign them to regions.

Step III : Creating style.css

name = Blue
description = A Drupal 7 Theme for practice
core = 7.x
stylesheets[all][] = css/style.css
regions[header] = Header
regions[banner] = Banner
regions[content] = Content
regions[sidebar] = Sidebar
regions[footer] = Footer

To add a  CSS file to your theme,you must include the line

stylesheets[all][] = css/style.css.

You should make sure that you have given the right path.You can do the styling of your theme according to your design. Here’s how I have written my CSS :

IFrame

Step IV : Adding Javascript

name = Blue
description = A Drupal 7 Theme for practice
core = 7.x
stylesheets[all][] = css/style.css
scripts[] = js/theme.js
regions[header] = Header
regions[banner] = Banner
regions[content] = Content
regions[sidebar] = Sidebar
regions[footer] = Footer

scripts[] = js/theme.js

You have to use Javascript and CSS in order to make your drop menu function properly.There are a number of Javascript plugins to choose from. For my theme I chose superfish js plugin. You can implement the js library in two ways, one is by adding the js library from web within a

TIL – Access Object Properties via Variable

I have been struggling hard since morning as I try to figure out something that was pretty simple in the end . The goal was to create a node object by adding the node field object properties dynamically. Everything looked fine but still it was not adding up.

After burning nearly 4 hours I figured out what was wrong and now it seriously makes me feel like a noob :(

So lets say we have an object $obj which has a property test. So basically to put in data in the object we can access it like this and put in the value.

$obj->test = "Blah Blah!!"

But in my case I needed to insert the data accessing the property via a variable. I was trying to go about it like :

$obj->test = "Blah Blah!!"

And was getting error of illegal string offset.

After having tried to make it work in innumerable ways that went in vain, I finally got the solution.

What I had to do was to wrap the variable to make it accessible by the object.

So the proper working way came around as this:

$obj->{$test} = "Blah Blah!!"

Again, feeling like a noob in PHP programming after this. But it feels great because there is always something to learn everyday. #FeelingOptimistic :)

Reference :
http://stackoverflow.com/questions/3515861/how-can-i-access-an-object-property-named-as-a-variable-in-php
https://imalabya.wordpress.com/2015/04/10/til-access-object-properties-via-variable

Do your Content Marketing Efforts measure up with your User Engagement Goals?

If you are looking to rev up a content marketing campaign to improve your user engagement metrics, you might as well put in some thought into tweaking your Content Engagement Strategy. Successful content strategies center around the preferences of your target audience wherein the communication is focused on what they are interested in. Online content that caters to your target audience can be dished out in different formats(infographics, e-books, brochures, videos, podcasts) to involve them in spontaneous conversations which can be a real-time feedback for your content marketing efforts.

Let’s have a look at the ways in which you can reach out to your target audience with some value-adding content marketing efforts.

# Create a Content Engagement Strategy

Once you have established yourself as a thought leader, the next immediate task would be to engage your audience’s attention on a consistent basis. While developing an engagement strategy you are obligated to put in efforts to create content themes and topics based on an in-depth research. Your content should be of value to your audience as you continue progressing through different stages of your content marketing program. Quality matters, so don’t end up mass producing content instead of focusing on its uniqueness quotient.

# Define Your Customer Segments

One of the key elements in content marketing is maintaining a sharp focus on your customer segment. Although digital marketing affords you the luxury of reaching out to a much larger audience, a sound content marketing strategy would be to concentrate your efforts on driving home the message to a single customer segment. The task of aligning your content marketing strategy with targeted pitching will help you identify your target buyer persona in the long run.

# Establish a Connect Between the Content & Your Audience

Content is an effective medium to build some online credibility. The engagement factor in content marketing can be a measure of your performance as a thought leader. According to a study by Aol & Nielson approximately 27,000,000 pieces of content are shared across the web space each day. Your audience plays the dual role of an influencer and a curator while sharing your content across different social media platforms. This makes it an imperative to deliver the message convincingly with a certain knack for creativity as the audiences today have a built-in BS detector that can tell apart a genuine approach from an exaggerated attempt at connecting.

# Fine Tune Your Content : Know what Your Audience is Looking For

Good content delivers value while boosting the growth of your business.The availability of multiple content marketing platforms has made it easier for content marketers to create and share customer-centric content. As a content marketer it is important that you keep an ear out for what your niche audience, competitors and industry experts are talking about. While crafting a content strategy for your audience, make sure that you add a valid call to action so as to engage them in meaningful conversations and  faster conversions.

# Ensure Consistency : Deliver Reliable Content in a Timely Fashion

Consistent content creation and dispersal through blog posts, newsletters, online brochure pages, social media updates and press releases let you deliver the marketing messages for an unparalleled impact. The key to maintaining consistency lies in sticking to an Editorial Calendar with an itinerary for all the content that needs to be published in sync with a marketing campaign.

Post sales queries, FAQs, Post sales informational content can come in handy while keeping your customers enticed and loyal to the brand. In a nutshell, avoid self serving messages and promotional content while opting for value adding content that solves the pain points of your audience and fills in the content gaps.

# Track Your Social Engagement Metrics

Social media engagement helps promote the growth in brand awareness while impacting the overall traffic to a website. Conversation, Amplification, applause and economic value are some social media metrics that let you evaluate the performance of your content. The conversations and interactions happening on social media platforms like Twitter, Facebook or LinkedIn indicate how findable your content is. Meanwhile the the shareability quotient of your content is reflected in the retweets, re-shares and repins on the popular social media platforms. The more your content gets shared the better is the amplification rate for it.

# Engagement Marketing

Traditional marketing has given way to a more customer centric version of it where behaviour driven marketing and multi-channel engagement lead improved interaction with your audiences. Targeted media relations are basically built around the theme of customer engagement. Studies have revealed that consumers feel more engaged when a brand tends to reach out to them through personalized messages. A consumer today is not just a passive recipient of your marketing messages. Brands indulge in engagement marketing to reach out to their audience with informative and thought provoking content.

As a Content Contributor or a content strategist you must realize that the scope of content marketing is not just limited to creating better user engagement. Value adding content ultimately creates enhanced user experiences for your niche segment that keeps coming back to you for that "go-to-expertise" to get their product/service related issues resolved.

Integrating Drupal 7 with MongoDB to Manage Dynamic Web Content

MongoDB can be easily integrated with Drupal 7 to support millions of dynamic web pages on a daily basis to speed up the websites. This document oriented application is a schema less database that can store large files without complicating your stack.

Here’s a look at how to install MongoDB on Linux and integrated it with Drupal 7.

Step I : Install MongoDB on Linux

# Importing the MongoDB public GPG Key

The Ubuntu package management tools (i.e. dpkg and apt) ensure package consistency and authenticity as the distributors need to sign up with GPG keys. The following command is to be issued to import the MongoDB public GPG Key:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

# Creating a list file for MongoDB.

Create a list file called mongodb-org-3.0.list using the following command:

echo "deb https://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
  
sudo apt-get update

# Installing the MongoDB packages.

Finally install the latest stable version of MongoDB.

sudo apt-get install -y mongodb-org

Reference: https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

 

Step II : Installing the MongoDB PHP driver using Pecl

Install Pecl to install MongoDB PHP if it is not installed already.

# Install PEAR

PEAR is installed to put in place a package and distribution system that is used by both PEAR and PECL

sudo apt-get install php-pear

# The php5-dev package when installed lets you access the PHP5 source files that are needed to compile additional modules:

sudo apt-get install php5-dev

In case you fail to install the php-dev package before trying to install a PECL extension using “pear install”,the following error will show up on your screen :

sh: phpize: not found ERROR: `phpize’ failed

# The PECL_HTTP extension requires an additional dependency package to be installed. sudo apt-get install libcurl3-openssl-dev # Install MongoDB PHP driver using Pecl:

Pecl is the preferred way to install the MongoDB driver.

pecl install mongo

# Add the mongo extension to php.ini file to Configuring PHP To Use The Driver.

extension=mongo.so

Reference: https://www.mkfoster.com/2009/01/04/how-to-install-a-php-pecl-extensionmodule-on-ubuntu/

https://spf13.com/post/getting-started-with-drupal-and-mongodb

Step III : Configuring Drupal to use MongoDB plugin

Download the MongoDB module ( https://drupal.org/project/mongodb) like any other module and place it in sites/all/modules directory.

Although there isn’t an admin interface to configure MongoDB, it is a fairly easier task to configure it manually.First create a file called local.settings.php and it should be in the same directory as settings.php.

Populate the file with the following contents. Make sure you replace the placeholders [YOURDATABASENAME] and [SITENAME

 array( // Connection name/alias
    'host' => 'localhost', // Omit USER:PASS@ if Mongo isn't configured to use authentication.
    'db' => 'mongo' // Database name. Make something up, mongodb will automatically create the database.
  ),
);
include_once('./includes/cache.inc');
# -- Configure Cache
$conf['cache_backends'][] = 'sites/all/modules/mongodb/mongodb_cache/mongodb_cache.inc';
$conf['cache_class_cache'] = 'DrupalMongoDBCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalMongoDBCache';
$conf['cache_default_class'] = 'DrupalMongoDBCache';
# -- Don't touch SQL if in Cache
$conf['page_cache_without_database'] = TRUE;
$conf['page_cache_invoke_hooks'] = FALSE;
# Session Caching
$conf['session_inc'] = 'sites/all/modules/mongodb/mongodb_session/mongodb_session.inc';
$conf['cache_session'] = 'DrupalMongoDBCache';
# Field Storage
$conf['field_storage_default'] = 'mongodb_field_storage';
# Message Queue
$conf['queue_default_class'] = 'MongoDBQueue';

Step IV : Enable the MongoDB module

NB:If you want to use MongoDB Block module then you need to disable the core block module as it conflicts with MongoDB Block which in turn does not allow Drupal to enable the MongoDB plugin.

In our case we did not use the MongoDB Block so we kept using the core block module.

MongoDB Module Installation

Fix common issues in the MongoDB integration with Drupal

I encountered a few issues while using this module. The first issue I faced was while adding a content type field using field storage as it threw back a warning that said:

Notice: Undefined property: EntityFieldQuery::$propertyConditions in mongodb_field_storage_query()

I fixed this issue by applying this patch.

The second issue was with saving a new content or node. The warning issued was about the save method that is being used to save records in MongoDB as it is deprecated and we need to use ‘w’ instead.

I edited the mongodb_field_storage.module and made changes to line number 198

$collection->save($new_entity, array('safe' => TRUE));

to

$collection->save($new_entity, array('safe' => TRUE, 'w' => 1));

We at Valuebound are committed to furthering your business initiatives with our Enterprise level web solutions. For further information on our service offerings, pleaseContact Us

Content Marketing Strategy for Lead nurturing and Successful Conversions

The Lead nurturing process plays the part of a catalyst that triggers the movement of leads down a sales funnel. Apart from the momentum it provides, lead nurturing gets the conversation going with prospects as they move through different phases of lead conversion to becoming “sales ready”. Content Marketing has evolved into a critical resource that breeds familiarity and establishes trust in a B2B or B2C lead nurturing initiative.

The relevancy of your content not only establishes your credentials as a “Go to Industry Expert”, it also lets you have these brand conversations with your audience for improved engagement and eventual conversions. Here we have a look at some ways you can use Content Marketing to nurture your leads and improve your lead conversion rates.

# Content Mapping

When you are done creating some visually appealing content like an infographic or something more intensive like a video that in all probability is set to go viral, the next thing to do is to map your content. Content mapping lets you take the impact levels of your content notches higher than what regular promotion would do. Content Mapping from the context of buyer personas helps you organize content and create blueprints for content distribution through the right channels at the right time so as to resolve their queries and doubts at different stages in the buying cycle.

# Content Retargeting

Often regarded as a paid search marketing strategy, the prime aim of a retargeting campaign is to recapture the interest of your web audience and nurture them in the process. A Content retargeting campaign lets you improve brand recall to stay connected with your audience in order to help boost your engagement levels. A sound understanding of your audience’s objectives will help your content marketing team in creating a retargeting strategy that leverages high quality informative content in varying formats. Blog post ideas sourced from active social media channels can be used to create consumable content that can be accompanied by strong calls to action to retarget your customers.    

# Drip Campaigns

Drip nurturing your sales leads gets easier when the prospects are nurtured to a sales ready state with the help of relevant information that is sent via emails over regular intervals of time. Content resources in varying formats are effective tools to kickstart a Drip Campaign which is largely an automated process wherein the information is literally “dripped” to your leads to keep them engaged and informed.

These drips can be customized according to the initial reactions of your prospects, for instance promotional drips can be designed to entice prospects with promotional offers while competitive drips can be targeted to lure your competitor’s customer base. You can target a particular segment based on their preference/feedback regarding the frequency of messages, type of content and the format they would like to receive the content resources in. Marketing Automation Software automates this content personalization process by sending out emails at regular intervals during a drip campaign.

# Brand Storytelling/ Brand Journalism

A multitude of online platforms and other social networking sites let you tell stories and post brand messages through content. Social media is indeed a potent medium to deliver your business messages without an emphasis on direct promotion.The fact that the tone of your content resonates with your web audience is what renders your storytelling effective as it results in the brand message being shared across different channels.

Your content must be compelling and factual with a special emphasis on customer centricity so that it captures the emotional attention of your audience and encourages buying. Your stories must inspire change with the desired outcome being the driving force behind the direction of the story. A documented content strategy in the form of an Editorial Calendar ensures that your storytelling is consistent and right on track.

# Engagement Marketing

Engagement Marketing

If your digital marketing campaign is not yielding results as you have anticipated, it may be the right time to review your campaign goals and evaluate the engagement metrics. With an ever-increasing usage of Adblock technologies by the online population, indulging in hard-sell by sending out self-aggrandizing messages through content marketing channels is bound to fall flat in the long run. Customer engagement should be the key goal of your content marketing initiative if you want to build brand awareness. While focusing on a narrative that is thought provoking and problem solving all the same, you can rest assured that your lead nurturing efforts will hit the target.

A lead nurturing campaign expects you to have a long term content strategy that addresses the need for a steady flow of content that can be repurposed based on a particular stage in the buying cycle. It is important that you get acquainted with your target audience’s expectations and pre purchase behaviour patterns before a headlong dash into wooing them with promotional content and other offers.

We at Valuebound keep a tab on the latest B2B content marketing trends and developments to provide you with Enterprise level web solutions to boost your digital marketing initiatives. For more information on our service offerings, please Contact Us

How to Create Custom Web Services for Drupal 7

Web based service applications/web services integrate different network platforms, applications, softwares and various other services to help you enjoy a seamless experience. Custom Web services allow you to display content from one site to another using the Services module.

In one of the recent project, we need to exposes value of filed collection items of a node via API. But default services provides only node values. THere Default services module does not provide the values from field collection items of a node while written custom web services can be used to fetch paired values of field collection items. I have created a Custom Web Service to get the Field Collection item value. I began with creating one content type “Housing Scheme” with the fields listed below :

# Title (Text)
# About Scheme ( Long Text)
# Distance from the City (Text)
# Nearest Major City ( Text)
# Locality Review( Long Text)
# Property Description ( Field Collection)

For this purpose, I used Drupal 7 and the Services module. I have written a custom module to handle the back end. The first step would be to download and install the Services module and enable the REST Server module that comes together with it.

Step I : Add service

To create a service you have to navigate to Service UI (admin/structure/services) and then click add service.

Add service

Step II : Open the Resources Page

The Open Resources Page will show a service list after you have saved a new service in it.

Now edit resources.

Service list page

Resources are available in default setup where all resources come hard-coded with the Services module.

Drupal Resources List

Step III : Create Custom Module

As my resources are not showing yet I have created a custom module for the same:

# Created custom module “housing_schemes_services”.
# Created directory for custom Drupal module in my Drupal site: /www/sites/all/modules/housing_schemes_services

I have empty files in my module directory:

  • housing_schemes_services.info
  • housing_schemes_services.module
  • includes/housing_schemes.services.inc

Step IV: Create the .info file

I added this code in housing_schemes.info file:

name = Housing Schemes Services
description = WebService APIs for Housing Schemes.
core = 7.x
package = Housing Schemes
project = housing_schemes
dependencies[] = services
dependencies[] = rest_server

 

Step V : Create the .module file

Then I added this code in housing_schemes_services.module:

/**
 * @file
 * Module file for Housing Schemes Services.
 * Contains the resource declarations for the service APIs
 * and other commons functions/hooks. if necessary
 */

/**
 * Implements hook_services_resources().
 * Create service resource for APIs to return the necessary json data.
 */
function housing_schemes_services_services_resources() {
  $resources = array();

//Include the necessary inc files.
  module_load_include('inc', 'housing_schemes_services', 'includes/housing_schemes.services');

//Service Apis for contents.
  $resources += housing_schemes_services_resource();

  return $resources;
}

Step VI : Create the .inc file

Finally I added this code in the housing_schemes.services.inc file:

function housing_schemes_services_resource() {
  $api = array(
	'housing_schemes' => array(
  	'operations' => array(
    	'retrieve' => array(
      	'help' => 'Retrieves housing schemes info.',
      	'file' => array(
        	'type' => 'inc',
        	'module' => 'housing_schemes_services',
        	'name' => 'includes/housing_schemes.services',
      	),
      	'callback' => 'housing_schemes_services_resource_retrieve',
      	'access callback' => 'user_access',
      	'access arguments' => array('access content'),
      	'access arguments append' => FALSE,
      	'args' => array(
        	array(
          	'name' => 'nid',
          	'type' => 'int',
          	'description' => 'Function to perform',
          	'source' => array(
            	'path' => '0'
          	),
          	'optional' => TRUE,
          	'default' => '0',
        	),
      	),
    	),
      	),
	),
  );

  return $api;
}

Created callback function retrieve

/**
 * [housing_schemes_services_resource_retrieve] definition.
 * Returns the information about a housing scheme.
 * @param $nid
 *   The nid of the housing_scheme node.
 * @return array
 *	The node processed information array.
 */
function housing_schemes_services_resource_retrieve($nid) {
  $node = node_load($nid);
  //Check if the node type is housing schemes.
  if ($node->type == 'housing_schemes') {
//Get PROPERTY DESCRIPTION data from field collection.
$property_description = $node->field_property_description[LANGUAGE_NONE][0][‘value’];
// here we are loading field collection
$pd_item = field_collection_item_load($property_description);

//getting field collection item value.
$pd_item_values = array(
  ‘scheme_type’ => $pd_item->field_scheme_type[LANGUAGE_NONE][0][‘value’],
  ‘area’ => $pd_item->field_area[LANGUAGE_NONE][0][‘value’],
  ‘property_type’ => $pd_item->field_property_type[LANGUAGE_NONE][0][‘value’],
  ‘budget’ => $pd_item->field_budget[LANGUAGE_NONE][0][‘value’],
);

	//PROPERTY DESCRIPTION ENDS.



//Create return object.
$return_obj = array(
  'scheme_name' => $node->title,
  'scheme_id' => $node->nid,
  'created_date' => $node->created,
  'about_scheme'=>$node->field_about_scheme[LANGUAGE_NONE][0]['value'],
  'distance_from_the_city'=>$node->field_from_city[LANGUAGE_NONE][0]['value'],
  'nearest_major_city' => $node->field_nearest_city[LANGUAGE_NONE][0]['value'],
  'locality_review' =>$node->field_locality_review[LANGUAGE_NONE][0]['value'],  
'property_description' => $pd_item_values,
	);
  }

  return $return_obj;
}

Step VII : Enable the Custom Drupal Module

Enable custom Module "Housing Scheme Services".

Enabling housing scheme services

Step VIII : Enable the Custom Service Resource

On Drupal site:

  1. Go to admin/structure/services/list/housing_scheme/resources
  2. Expand the "housing_schemes" under the "Resource" column then check the box and click save.

Custom resource

Test the Custom Service Resource

After enabling the resource you will be able to query the service by navigating to this path :

http://localhost/drupal/cf_api/housing_scheme/{{nodeid}}.json

It will return the Housing Scheme’s node details so that you are able to get field collection item values in your Services. You should be able to use JSON dump to consume the data in your application.

We at Valuebound are committed to creating exceptional web experiences and solutions based on your unique business needs. For further information on our service offerings, please Contact Us.

Cheatsheet for an Editorial Calendar : Gearing up for a Content Marketing Initiative

A Content Marketing campaign gains the right momentum when the entire content creation process has been scheduled in advance. The chief objective of having an editorial calendar is to showcase your content before the right audience at the right time. An ideal content calendar lets you save time while ensuring consistent content creation and repurposing. A key content marketing tool, an editorial calendar is instrumental in tending to your web properties as it lets you plan beforehand in more ways than one that we have covered here.

# Get a grip on your Basics : Let the Ideas germinate

Before you go about the task of filling in the entries for a content creation schedule, it is crucial that you take stock of the who’s,hows and whys of your Content marketing strategy. After you have identified your target audience and the motive behind content creation, the ideation phase lets you come up with probable content ideas and formats that are ideal for content generation. The Editorial Calendar must be designed in a way to keep the content contributors and the key stakeholders in the loop about how the Content Marketing initiative is progressing.

#  Plan ahead : Calendar for Content Strategy

The more well-defined your target, the clearer is your content strategy. While creating content for a specific audience the focus should be on the generation of marketing content that is customer centric. An editorial calendar brings in a disciplined approach that lets you attach a time frame or a deadline for your content marketing efforts. A regularly updated publishing schedule will make it easier to keep track of your content plans. If you are planning a viral marketing campaign on popular social marketing platforms, a content calendar that keeps track of the content generation and the frequency of social media postings is exactly what you need.

# Repurposing Content : Recycle your Best Content

An editorial Calendar affords you the much needed luxury of repurposing your content. As you keep repeating your valuable content in varying formats, the content marketing initiative receives a major boost as the shelf-life of your content increases. It lets you minimize the time lost in the ideation and creation of fresh content. For instance a blog post can be repurposed into a slideshow or an infographic while multiple blog posts from a particular series can be clubbed together to create an E-book.

# Master Editorial Calendar:Get an Overview

A Master Editorial Calendar is meant to provide you with a monthly/weekly overview of how your content marketing efforts have paid off. It lets you create a Content Timeline on a monthly,quarterly or annual basis. A content log helps you keep track of the changes made in the content based on date it was published on.You could also add data from analytics tools like Google Analytics to the calendar and track the performance of all your content items on different platforms.

# Track new ideas using a Content Calendar

An Editorial Calendar lets you record content ideas generated during all those brainstorming sessions or the inspirational moments in the ideation phase. Editorial Calendar tools cater to both SMEs and major organizations alike as they play a major role in keeping the content consistent and relevant. Google Doc is a widely used Editorial Calendar solution for its ability to support collaborative editing while you go about scheduling your weekly/monthly content calendar.

Kapost is another popular editorial calendar tool that helps you track the workflow of your content marketing strategy through the ideation, execution and promotion stages. This software would be an ideal choice if you plan on generating large volumes of content. Content Marketing tools like Gather Content can be used in sync with editorial calendar solutions like Excel spreadsheet/ Google Spreadsheet.

The current process of planning a content marketing initiative revolves around content amplification strategies that are executed in accordance with the schedule in a content calendar. Although there are multiple Editorial Calendar formats available to choose from, you should ideally stick to a single format that you have zeroed in on based on your business model.

We at Valuebound keep a tab on the latest B2B content marketing trends and developments to provide you with Enterprise level web solutions to boost your digital marketing initiatives. For more information on our service offerings, please Contact Us

How to Set up Instamojo Payment Gateway Module in Drupal Commerce

The Instamojo Payment Gateway is an easy way to collect payments for the digital sale of products ranging from instant downloads and subscriptions to physical goods and business services. To install the Commerce Instamojo Payment Gateway Module in your Drupal commerce (https://www.drupal.org/project/commerce), download the module and add it to your sites/all/modules directory. Enable it under /admin/build/modules.

Enable instamojo module

Configuring the Module

Step I

Login to your Instamojo account and create a payment link. You can select the “Pay What You Want” option for pricing your products.

Create a Payment Link in your Instamojo account

Step II

Navigate to Advanced Settings of the payment link to put your site URL/response_page and click on the “Get Started” button.

Advance settings of payment link

Add custom redirection URL as yoursiteurl/response_page. Replace yoursiteurl with your own site URL.

Step III

The Payment Link will look like this : instamojo-name/username/slug. The payment URL link is to be added in the module configuration page. Copy the payment URL as shown in the screenshot below :

Payment URL link

Step IV

Now navigate to the Instamojo Dashboard’s Footer and click on the Developers link.

developer link on Instamojo site

Step V

On your developers Page, you will find the Private API Key & the Private Authentication Token.

Instamojo for Developers-API & Auth Token

Step VI

Now fill the values on module configuration page.

Store > Configuration > Payment Methods

Or you can browse directly through : http://mystore.com/admin/commerce/config/payment-methods

Private API Key & Token: Copy it from Step VI

Virtual Payment Client Url : URL copied as in Step III

Site URL: your_site_url (Replace this with your site URL without “/”)

Current Payment Api URL: https://www.instamojo.com/api/1.1/payments

Instamojo Drupal Module Configuration Page

Now you are all set to use the Instamojo Payment Gateway.

If you face any issues while setting up the module, please update it in Drupal issue queue here. You can also Contact us for site specific paid customization of the module and further information on our service offerings.

Download the Drupal Guide
Enter your email address to receive the guide.
get in touch