calendarChallenge? Substract dates in Marketo to obtain an amount of dates or hours. Whilst this is possible in Salesforce, it’s not possible in Marketo. At least not now, when I’m writing the blogpost.

Solution? Write your own calculation script (in PHP) and take full advantage of the Marketo Webhook functionality. But first; Make sure you know, what you need to know, about Marketo Webhooks.

 

 

Step1. Write a simple script in PHP to substract dates. Place it on a server through FTP. Here is the script I use to get the amount of days:

<?php header(“Content-type: text/xml”);
echo ‘<?xml version=”1.0″ encoding=”UTF-8″?>’;
echo ‘<note>’;
echo’    <days>’; $start = strtotime($_GET[‘start’]); $end = strtotime($_GET[‘end’]); $seconds = $end – $start; $days = round(($seconds/60/60/24)+1); echo $days; echo ‘</days>’;
echo’    <weeks>’; $weeks = ceil($days/7); echo $weeks; echo ‘</weeks>’;
echo ‘</note>’; ?>

webhooks2

 

 

 

 

 

 

The script above outputs in XML, when you call the URL like this: http://www.diederikmartens.com/XXXXXXXteapi.php?start=2014-01-01&end=2014-01-31.

Step 2. Now we are ready to set up the webhook in Marketo. First start with creating your new field in Marketo that will hold date amount of days (or weeks).

webhooks

UPDATE
You don’t have to be a coding guru to pull this off! CALCITNOW allows you to create formulas on the fly. You can acquire a CALCITNOW license at http://www.smops-soft.com/calcitnow. Please note that you will need to create a free SMOps account first, in order to acquire licenses.

If you have any questions, just leave them below this post.

 

About the author

Diederik Martens Marketing Operations Contractor

Diederik Martens is a results-driven digital marketer with a passion for B2B and the complex sale. Diederik is a frequently asked speaker and lecturer on marketing operations, marketing automation, lead nurturing, buying journeys, CRM, Predictive Lead Scoring, and marketing technology. Diederik is Marketo Certified and experienced in Salesforce. Marketo honored Diederik as one of the world’s top 50 by naming him to the 2014, 2015, and 2016 Marketo Champion Elite class. In 2015, Diederik was awarded a Killer Content Award in 2015 for his nurture campaign strategy at Quintiq.

Comments (1)

Visitor2
Diederik Martens
21/10/2015

The real solution is here! You don’t have to be a coding guru to pull this off! CALCITNOW(c) allows you to create formulas on the fly. You can acquire a CALCITNOW license at http://www.smops-soft.com/calcitnow. Please note that you will need to create a free SMOps account first, in order to acquire licenses.

Reply

New Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>