Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
themeEclipse
languagejs
titleCalling a Custom Activity from JavaScript
linenumberstrue
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="description" content="%%description%%" />
    <title>%%title%%</title>
    
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script>
      //The activity is logged on button click. 
      $(document).ready(function(){
        $('#my_activity_button').on ('click', function (){
        	
          //START: This is the code to log the custom activity
          ll_api.log_prospect_activity ({
              activity_identifier: 'ordered_pizza__c',
              activity_info: 'Ordered one stuffed crust pizza with extra cheese',
              activity_fields: {
                  price__c: '13.5',
                  size__c: 'Large',
                  delivery_date__c: '2016-11-20'
              }
          }, function (response){
              console.log (response) //{success: 1, message: "Success"}
          });
          //END: This is the code to log the custom activity
          
        })
      })
    </script>
  </head>
  <body>
    %%content%%
  </body>
</html>

Viewing Custom Activities

Custom activities along with their details get logged into a Prospect's Profile. In the example below, we can see the pizza order that was logged when the prospect clicked a button on the web page. 

Image Added

Using Custom Activity Data as Criteria

...