. */ if( !defined( 'ABSPATH' ) ) { exit( 'You are not allowed to access this file directly.' ); } // Register style sheet. add_action('wp_enqueue_styles', 'agilecrm_campaigns_css' ); /** * Register style sheet. */ function agilecrm_campaigns_css() { wp_enqueue_style( 'agilecrm-campaigns', plugins_url( '/css/style.css', __FILE__ ) ); } add_action( 'wp', 'agilecrm_campaigns_landing_page_setpup', 10, 0 ); function agilecrm_campaigns_landing_page_setpup(){ if(!is_admin()){ global $post; $campaigns_landing_page = get_post_meta($post->ID, 'campaigns_landing_page',true); if($campaigns_landing_page != ""){ $domain = (sanitize_text_field(get_option( "campaigns_agile_domain" ))); $email= (sanitize_email(get_option( "campaigns_agile_email" ))); $rest_api = (sanitize_text_field(get_option( "campaigns_agile_rest_api" ))); if($domain != "" && $email != "" && $rest_api != ""){ $request = wp_remote_get('https://'.$domain.'.agilecrm.com/landing/'.$campaigns_landing_page); echo $response = wp_remote_retrieve_body( $request ); die(); } } } } add_action( 'init', 'agilecrm_campaigns_list_agile_form', 10, 0 ); function agilecrm_campaigns_list_agile_form(){ if(isset($_GET["agile_list_form"]) == 1){ $domain = (sanitize_text_field(get_option( "campaigns_agile_domain" ))); $email= (sanitize_email(get_option( "campaigns_agile_email" ))); $rest_api = (sanitize_text_field(get_option( "campaigns_agile_rest_api" ))); if($domain != "" && $email != "" && $rest_api != ""){ $agile_url = "https://" .$domain. ".agilecrm.com/dev/api/"; $headers = array( 'Authorization' => 'Basic ' . base64_encode( $email. ':' .$rest_api ), 'Content-type' => 'application/json', 'Accept' => 'application/json' ); $args = array( 'timeout' => 120, 'sslverify' => false, 'headers' => $headers ); $request = wp_remote_get($agile_url.'forms',$args); $result = wp_remote_retrieve_body( $request ); if (version_compare(PHP_VERSION, '5.4.0', '>=') && !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) { $result = json_decode($result,false, 512, JSON_BIGINT_AS_STRING); } else { $result = json_decode($result,false); } $data = array(); if(count($result) > 0){ foreach($result as $k => $v){ $tmp = array(); $tmp["text"] = $v->formName; $tmp["value"] = $v->id; $data[] = $tmp; } } echo json_encode($data); } die(); } } add_action('admin_menu', 'agilecrm_campaigns_create_menu'); function agilecrm_campaigns_create_menu() { add_menu_page('Agile CRM Campaigns', 'Agile CRM Campaigns', 'administrator', 'agilecrm_campaigns_dashboard', 'agilecrm_campaigns_dashboard_page',plugins_url( 'agilecrm-campaigns/images/icon.png' ),0); add_submenu_page('agilecrm_campaigns_dashboard', 'Home', 'Home', 'administrator', 'agilecrm_campaigns_dashboard', 'agilecrm_campaigns_dashboard_page'); add_submenu_page('agilecrm_campaigns_dashboard','Web Rules','Web Rules','administrator', 'agilecrm_campaigns_webrules', 'agilecrm_campaigns_webrules_page' ); add_submenu_page('agilecrm_campaigns_dashboard','Form Builder','Form Builder','administrator', 'agilecrm_campaigns_formbuilder', 'agilecrm_campaigns_formbuilder_page' ); add_submenu_page('agilecrm_campaigns_dashboard','Landing Pages','Landing Pages','administrator', 'agilecrm_campaigns_landing', 'agilecrm_campaigns_landing_page' ); add_submenu_page('agilecrm_campaigns_dashboard','Email Campaigns','Email Campaigns','administrator', 'agilecrm_campaigns_email', 'agilecrm_campaigns_email_page' ); add_submenu_page('agilecrm_campaigns_dashboard','Web Stats','Web Stats','administrator', 'agilecrm_campaigns_webstats', 'agilecrm_campaigns_webstats_page' ); add_submenu_page('agilecrm_campaigns_dashboard','Refer a Friend','Refer a Friend','administrator', 'agilecrm_campaigns_refer', 'agilecrm_campaigns_refer_page' ); add_submenu_page('agilecrm_campaigns_dashboard','Settings','Settings','administrator', 'agilecrm_campaigns_settings', 'agilecrm_campaigns_settings_page' ); } function agilecrm_campaigns_header($domain){ $campaigns_agile_email = (sanitize_email(get_option( "campaigns_agile_email" ))); $campaigns_agile_password = (sanitize_text_field(get_option( "campaigns_agile_password" ))); agilecrm_campaigns_css(); $page_name = $_GET['page']; if($page_name == 'agilecrm_campaigns_dashboard') { agilecrm_campaigns_hidedata_js(); ?>
"; ?>
Your settings have been updated successfully."; } $restatus = $_GET['restatus']; if($restatus) { echo "
You have successfully created your Agile CRM account.
"; } } else { ?>
"; ?>
ID , 'campaigns_enable_webrule', 2); else update_post_meta($page->ID , 'campaigns_enable_webrule', 1); } if ( get_option( "campaigns_agile_webstats" ) !== false ) { update_option( "campaigns_agile_webstats", $webstats); } else { add_option( "campaigns_agile_webstats", $webstats, $deprecated, $autoload ); } $pages = get_pages(); foreach ( $pages as $page ) { if($webstats == "0") update_post_meta($page->ID , 'campaigns_enable_webstats', 2); else update_post_meta($page->ID , 'campaigns_enable_webstats', 1); } } agilecrm_campaigns_header($domain); ?>

Complete All-In-One CRM with Marketing, Sales & Service Automation with Telephony, Helpdesk, Web Engagement, Social Media Integration, Email Campaigns, Mobile Marketing and much more.

Access Agile CRM Account & Setup
ID , 'campaigns_enable_webstats', 2); else update_post_meta($page->ID , 'campaigns_enable_webstats', 1); } } //agile_css(); agilecrm_campaigns_header($domain); $webstats= get_option( "campaigns_agile_webstats" ); if($webstats === false){ add_option( "campaigns_agile_webstats", 1, $deprecated, $autoload ); $webstats= 1; } ?>
"; ?>
";?>


Get actionable insights into customer acitvity on your site or app and detailed web analytics reports for each of your customers. Learn about the traffic source of your new customers with referral URL reporting in Agile CRM, and show personalized messages to your contacts.

/> Web Stats

WEB STATS

Web Stats-By ticking the checkbox, the analytics will be automatically activated and synced with your Agile CRM account. You can view this in your dashboard. Agile's Analytics CRM gives you deep insight into customer behavior and website performance.

";?>

Agile offers you contact-level analytics and web traffic analysis for companies that are serious about growth.

WEB STATS

Agile's Analytics CRM gives you deep insight into customer behavior and website performance. Agile offers you contact-level analytics and web traffic analysis for companies that are serious about growth.

You can use javascript API to track page views on your site, add / delete contacts from your website or blog directly. Copy and paste the below code in your webpage's HTML just before the tag to enable tracking / API methods.

Read more
ID , 'campaigns_enable_webrule', 2); else update_post_meta($page->ID , 'campaigns_enable_webrule', 1); } } agilecrm_campaigns_header($domain); $webrules = get_option( "campaigns_agile_webrules" ); if($webrules === false){ add_option( "campaigns_agile_webrules", 1, $deprecated, $autoload ); $webrules = 1; } $campaigns_agile_email = (sanitize_email(get_option( "campaigns_agile_email" ))); $campaigns_agile_password = (sanitize_text_field(get_option( "campaigns_agile_password" ))); agilecrm_campaigns_custom_pubnub_refresh_js (); ?>

Templates

"; ?>
Go
'Basic ' . base64_encode( $email. ':' .$rest_api ), 'Content-type' => 'application/json', 'Accept' => 'application/json' ); $args = array( 'timeout' => 120, 'sslverify' => false, 'headers' => $headers ); $request = wp_remote_get($agile_url.'webrule',$args); $result = wp_remote_retrieve_body( $request ); $result = json_decode($result, false); echo "
"; ?> 0){ ?>
$v){ ?> "; ?>
S.No Name Action
".$i.".".ucfirst($v->name)."actions; foreach($actions as $as => $av){ $action = $av->action; if($action == 'CORNER_NOTY'){ $out = 'Noty message'; } $output = str_replace('_', ' ', $action); $output = strtolower($output); echo $out = ucfirst($output); } ?> disabled; if($disable){ ?> Disabled
";?>
S.No. Name Preview
Sorry, you don't have any Web Rules yet.

Web Rules

Web Rules allow you to set action items for your website visitors. Based on the actions, you can place a popup, increase the lead score, and many other things through Web Rules.

"; ?>

For example, when visitors are about to leave your website, show them a sign-up popup. When contacts in Agile visit a specific product page, send them an email asking if they need a demo.

Setup Tracking Code

To start using Web Rules, please setup our tracking code.

What are Web Rules?

Web Rules allow you to perform certain actions when people visit your website - like showing a popup or increase score.

For example, when visitors are about to leave your website, show them a sign-up popup. When contacts in Agile visit a specific product page, send them an email asking if they need a demo.

Read more

Template

"; ?>
Go
'Basic ' . base64_encode( $email. ':' .$rest_api ), 'Content-type' => 'application/json', 'Accept' => 'application/json' ); $args = array( 'timeout' => 120, 'sslverify' => false, 'headers' => $headers ); $request = wp_remote_get($agile_url.'landingpages',$args); $result = wp_remote_retrieve_body( $request ); if (version_compare(PHP_VERSION, '5.4.0', '>=') && !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) { $result = json_decode($result,false, 512, JSON_BIGINT_AS_STRING); } else { $result = json_decode($result,false); } echo "
"; ?> 0){ ?>
$v){ ?> "; ?>
S.No. Name Preview
".$i.".".$v->name."id."'> "; ?>
";?>
SNo Name Preview
Sorry, you dont have any Landing Pages yet.

Landing Page

Landing pages are your lead magnet - a web page created to gather leads online. Create a landing page in Agile CRM and link it from your website, email messages or online ads.

"; ?>

Add a form to your landing page to gather visitor details, create contacts in Agile CRM automatically, and nurture them using campaigns.

How to use Landing Pages?

Landing page is your lead magnet - a web page created to gather leads online. Create a landing page in Agile and link it from your website, email messages or online ads. Add a Form to your landing page to gather visitor details, create Contacts in Agile automatically and nature them using Campaigns.

What are Landing Pages?

The Landing Page Builder helps create high converting landing pages in Agile CRM. With Agile's rich and customizable templates, drag & drop designer features, web forms, responsive designs and code editor, experience a new level in building high quality landing pages.

Read more

Templates

"; ?>
Go
"; ?>
Go
"; ?>
Go
"; ?>
Go
'Basic ' . base64_encode( $email. ':' .$rest_api ), 'Content-type' => 'application/json', 'Accept' => 'application/json' ); $args = array( 'timeout' => 120, 'sslverify' => false, 'headers' => $headers ); $request = wp_remote_get($agile_url.'forms',$args); $result = wp_remote_retrieve_body( $request ); $result = json_decode($result, false); echo "
"; $i = 1; ?> 0){ ?>
$v){ ?> "; ?>
S.No. Name Preview
".$i.".".$v->formName." "; ?>
"; ?>
S.No Name Preview
Sorry, you dont have any Forms yet.

Form Builder

Form Builder helps you create your custom web forms easily, and you can place it on your website. Whenever a web visitor fills up the web form, a new contact gets created in Agile CRM, and all the data submitted through the form gets added to the contact page as various attributes

"; ?>

Name, Company, Phone number, Email, Address, Notes etc. Also, you can keep tracking this contact whenever he visits your website and get his detailed browsing history on the contact page.

What are Forms?

Forms created using the Form Builder can be placed on your website or app. These Forms are readily linked to your Agile account. When a visitor fills the form, a Contact is created and subsequent web activity is logged automatically.

Agile's Form Builder helps you create your custom web forms at ease and place it on your website. Whenever a web visitor fills up the web form, a new contact gets created in Agile and all the data submitted through the form gets added to the contact page as various attributes - Name, Company, Email, Phone no, Address, Notes etc, Also, you can keep tracking this contact whenever he visits your website & get his detailed browsing history on the contact page.

Read more
"; ?>

Refer a Friend

Our customers are our biggest ambassadors. Your love for the product is what makes you refer other awesome clients to us time and again. Not surprisingly, 'word of mouth' has been our most successful source of new customers. We’d like to show our gratitude to all of you who take the time to recommend us to your colleagues and partners.

Refer a Friend

Follow us on Twitter:
Follow @agilecrm on Twitter and share about Agile CRM to claim 500 extra emails.

Tweet about us:
Mention and retweet about Agile CRM on your Twitter timeline to claim 500 extra emails.

Share on Facebook:
Share Agile updates with your Facebook contacts to claim 500 extra emails.

Refer friends:
Invite friends to sign up and try Agile CRM to claim 500 extra emails per signup.

Write a blog about us:
Blog about Agile CRM and spread the word for 2500 extra emails.

Read more
'Basic ' . base64_encode( $email. ':' .$rest_api ), 'Content-type' => 'application/json', 'Accept' => 'application/json' ); $args = array( 'timeout' => 120, 'sslverify' => false, 'headers' => $headers ); $request = wp_remote_get($agile_url.'workflows',$args); $result = wp_remote_retrieve_body( $request ); $result = json_decode($result, false); echo "
"; $i = 1; ?> 0){ ?>
$v){ ?> "; ?>
S.No. Name
".$i.".".ucfirst($v->name)."is_disabled; if($disable){ ?>Disabled
"; ?>
S.No Name Preview
Sorry, you dont have any Campaigns yet.

Campaigns

Email Campaigns-Track the effectiveness of your email campaigns with real-time notifications for email opens. Email tracking software takes on a better way to give the analytics on campaign emails.

"; ?>

Enjoy effective templates, personalization, scoring and tagging, advanced reporting, automated responders, real-time alerts and Email A/B testing with Agile's Email Marketing CRM.

News Letters

Newsletter-Track the effectiveness of your newsletter campaigns with real-time notifications for email opens. Email tracking software takes on a better way to give the analytics on campaign emails.

"; ?>

Enjoy effective templates, personalization, scoring and tagging, advanced reporting, automated responders, real-time alerts and Email A/B testing.

Email Campaigns

Run bulk email campaigns, send newsletters and track performance with Agile CRM's email marketing tools. Enjoy effective templates, personalization, scoring and tagging, advanced reporting, automated responders, real-time alerts and Email A/B testing with Agile's Email Marketing CRM.

Read more
'Basic ' . base64_encode( $email. ':' .$password ), 'Content-type' => 'application/json', 'Accept' => 'application/json' ); $args = array( 'timeout' => 120, 'sslverify' => false, 'headers' => $headers ); $request = wp_remote_get($agile_url.'api-key',$args); $result = wp_remote_retrieve_body( $request ); $arr = json_decode($result, TRUE); extract($arr); $rest_api = $api_key; $js_api = $js_api_key; if($rest_api){ if ( get_option( "campaigns_agile_rest_api" ) !== false ) { update_option( "campaigns_agile_rest_api", $rest_api); } else { add_option( "campaigns_agile_rest_api", $rest_api, $deprecated, $autoload ); } if ( get_option( "campaigns_agile_js_api" ) !== false ) { update_option( "campaigns_agile_js_api", $js_api); } else { add_option( "campaigns_agile_js_api", $js_api, $deprecated, $autoload ); } if ( get_option( "campaigns_agile_domain" ) !== false ) { update_option( "campaigns_agile_domain", $domain); } else { add_option( "campaigns_agile_domain", $domain, $deprecated, $autoload ); } if ( get_option( "campaigns_agile_email" ) !== false ) { update_option( "campaigns_agile_email", $email); } else { add_option( "campaigns_agile_email", $email, $deprecated, $autoload ); } $hash_password = wp_hash_password( $password ); if ( get_option( "campaigns_agile_password" ) !== false ) { update_option( "campaigns_agile_password", $hash_password); } else { add_option( "campaigns_agile_password", $hash_password, $deprecated, $autoload ); } wp_enqueue_script('refresh',plugins_url('/js/refreshpage.js', __FILE__),array('jquery') ); }else{ $errors = 'Please verify the above details given in the above fields'; } } if($_POST["save"] && check_admin_referer( 'agilecrm_campaigns_nonce_action', 'agilecrm_campaigns_nonce_field' )){ $domain = sanitize_text_field($_POST["domain"]); $email= sanitize_email($_POST["email"]); $password= sanitize_text_field($_POST["password"]); $agile_url = "https://" .$domain. ".agilecrm.com/dev/api/"; $headers = array( 'Authorization' => 'Basic ' . base64_encode( $email. ':' .$password ), 'Content-type' => 'application/json', 'Accept' => 'application/json' ); $args = array( 'timeout' => 120, 'sslverify' => false, 'headers' => $headers ); $request = wp_remote_get($agile_url.'api-key',$args); $result = wp_remote_retrieve_body( $request ); $arr = json_decode($result, TRUE); extract($arr); $rest_api = $api_key; $js_api = $js_api_key; if($rest_api){ if ( get_option( "campaigns_agile_rest_api" ) !== false ) { update_option( "campaigns_agile_rest_api", $rest_api); } else { add_option( "campaigns_agile_rest_api", $rest_api, $deprecated, $autoload ); } if ( get_option( "campaigns_agile_js_api" ) !== false ) { update_option( "campaigns_agile_js_api", $js_api); } else { add_option( "campaigns_agile_js_api", $js_api, $deprecated, $autoload ); } if ( get_option( "campaigns_agile_domain" ) !== false ) { update_option( "campaigns_agile_domain", $domain); } else { add_option( "campaigns_agile_domain", $domain, $deprecated, $autoload ); } if ( get_option( "campaigns_agile_email" ) !== false ) { update_option( "campaigns_agile_email", $email); } else { add_option( "campaigns_agile_email", $email, $deprecated, $autoload ); } $hash_password = wp_hash_password( $password ); if ( get_option( "campaigns_agile_password" ) !== false ) { update_option( "campaigns_agile_password", $hash_password); } else { add_option( "campaigns_agile_password", $hash_password, $deprecated, $autoload ); } wp_enqueue_script('refresh',plugins_url('/js/refreshpage.js', __FILE__),array('jquery') ); }else{ $errors = 'Please verify the above details given in the above fields'; } } $rest_api = (sanitize_text_field(get_option( "campaigns_agile_rest_api" ))); $js_api = (sanitize_text_field(get_option( "campaigns_agile_js_api" ))); $domain = (sanitize_text_field(get_option( "campaigns_agile_domain" ))); $email= (sanitize_email(get_option( "campaigns_agile_email" ))); $password= (sanitize_text_field(get_option( "campaigns_agile_password" ))); agilecrm_campaigns_header($domain); ?>

Settings

.agilecrm.com
' . $errors . '
'; ?>
Do not have an account with Agile CRM?
It's fast and free for Ten users

Benefits of Agile CRM Plugin

"; echo "#page-list label{width:50%;float:left}"; echo ""; echo ""; } add_action('admin_head', 'agilecrm_campaigns_button'); function agilecrm_campaigns_button() { global $typenow; // check user permissions if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) { return; } // verify the post type if( ! in_array( $typenow, array( 'post', 'page' ) ) ) return; // check if WYSIWYG is enabled if ( get_user_option('rich_editing') == 'true') { add_filter("mce_external_plugins", "agilecrm_campaigns_add_tinymce_plugin"); add_filter('mce_buttons', 'agilecrm_campaigns_register_button'); } } function agilecrm_campaigns_add_tinymce_plugin($plugin_array) { $plugin_array['agilecrm_campaigns_button'] = plugins_url( '/js/agile.js', __FILE__ ); // CHANGE THE BUTTON SCRIPT HERE return $plugin_array; } function agilecrm_campaigns_register_button($buttons) { array_push($buttons, "agilecrm_campaigns_button"); return $buttons; } add_shortcode('agileform_campaigns','agileform_campaigns'); function agileform_campaigns($atts,$content,$tag){ if(isset($atts["id"])){ $domain = (sanitize_text_field(get_option( "campaigns_agile_domain" ))); $email= (sanitize_email(get_option( "campaigns_agile_email" ))); $rest_api = (sanitize_text_field(get_option( "campaigns_agile_rest_api" ))); if($domain != "" && $email != "" && $rest_api != ""){ $agile_url = "https://" .$domain. ".agilecrm.com/dev/api/"; $headers = array( 'Authorization' => 'Basic ' . base64_encode( $email. ':' .$rest_api ), 'Content-type' => 'application/json', 'Accept' => 'application/json' ); $args = array( 'timeout' => 120, 'sslverify' => false, 'headers' => $headers ); $request = wp_remote_get($agile_url.'forms/form?formId='.$atts["id"],$args); $result = wp_remote_retrieve_body( $request ); $result = json_decode($result, false); $result = $result->formHtml; return $result; } } } function agilecrm_campaigns_custom_pubnub_refresh_js() { $rest_api = (sanitize_text_field(get_option( "campaigns_agile_rest_api" ))); $page = $_GET['page']; if($page =='agilecrm_campaigns_webrules' || $page =='agilecrm_campaigns_landing' || $page =='agilecrm_campaigns_formbuilder' || $page =='agilecrm_campaigns_email'){ wp_enqueue_script('pubnub_autorefresh',plugins_url('/js/process-pubnub.js', __FILE__), array(), TRUE ); } wp_add_inline_script( 'pubnub_autorefresh', ' //this function will work cross-browser for loading scripts asynchronously function loadScript(src, callback) { var s, r, t; r = false; s = document.createElement(\'script\'); s.type = \'text/javascript\'; s.src = src; s.async = true; s.onload = s.onreadystatechange = function() { //console.log( this.readyState ); //uncomment this line to see which ready states are called. if ( !r && (!this.readyState || this.readyState == \'complete\') ) { r = true; callback(); } }; t = document.getElementsByTagName(\'script\')[0]; t.parentNode.insertBefore(s, t); }; loadScript("'.plugins_url('/js/pubnub-3.4.min.js', __FILE__).'", function() { Agile_Pubnub = PUBNUB.init({ "publish_key" : "pub-c-e4c8fdc2-40b1-443d-8bb0-2a9c8facd274", "subscribe_key" : "sub-c-118f8482-92c3-11e2-9b69-12313f022c90", ssl : true, origin : "pubsub.pubnub.com", }); Agile_Pubnub.subscribe({ channel : getAgileChannelName(), restore : false, message : function(message, env, channel) { console.log(message); var action = message.action; var name = message.type; if(name== "WebRule"){ window.location.href = "admin.php?page=agilecrm_campaigns_webrules"; }else if(name== "LandingPages"){ window.location.href = "admin.php?page=agilecrm_campaigns_landing"; }else if(name=="Forms"){ window.location.href = "admin.php?page=agilecrm_campaigns_formbuilder"; }else if(name=="Campaigns"){ window.location.href = "admin.php?page=agilecrm_campaigns_email"; } }}); }); function getAgileChannelName(){ return '.json_encode($rest_api).'; }' ); } add_action ( 'admin_enqueue_scripts', 'agilecrm_campaigns_custom_pubnub_refresh_js'); function agilecrm_campaigns_footer() { global $post; $js_api = (sanitize_text_field(get_option( "campaigns_agile_js_api" ))); $domain= (sanitize_text_field(get_option( "campaigns_agile_domain" ))); $rest_api = (sanitize_text_field(get_option( "campaigns_agile_rest_api" ))); $email= (sanitize_email(get_option( "campaigns_agile_email" ))); $webrules = get_option( "campaigns_agile_webrules" ); $webstats = get_option( "campaigns_agile_webstats" ); $pagewebrule = get_post_meta($post->ID, 'campaigns_enable_webrule',true); $pagewebstats=get_post_meta($post->ID, 'campaigns_enable_webstats',true); $agile_url = "https://" .$domain. ".agilecrm.com/dev/api/"; $headers = array( 'Authorization' => 'Basic ' . base64_encode( $email. ':' .$rest_api ), 'Content-type' => 'application/json', 'Accept' => 'application/json' ); $args = array( 'timeout' => 120, 'sslverify' => false, 'headers' => $headers ); $request = wp_remote_get($agile_url.'subscription',$args); $result = wp_remote_retrieve_body( $request ); $arr = json_decode($result, TRUE); $plantype = $arr['plan']['plan_type']; if($plantype == "FREE" && $domain){ if($webstats == $pagewebstats && $webrules == $pagewebrule){ wp_enqueue_script( 'main-js', 'https://'.$domain.'.agilecrm.com/stats/min/agile-min.js', array('jquery') ); wp_add_inline_script( 'main-js', '_agile.set_account("'.$js_api.'","'.$domain.'"); _agile_execute_web_rules();_agile.track_page_view();' ); } elseif($webstats == $pagewebstats){ wp_enqueue_script( 'main-js', 'https://'.$domain.'.agilecrm.com/stats/min/agile-min.js', array('jquery') ); wp_add_inline_script( 'main-js', '_agile.set_account("'.$js_api.'","'.$domain.'");_agile.track_page_view();' ); } elseif($webrules == $pagewebrule){ wp_enqueue_script( 'main-js', 'https://'.$domain.'.agilecrm.com/stats/min/agile-min.js', array('jquery') ); wp_add_inline_script( 'main-js', '_agile.set_account("'.$js_api.'","'.$domain.'"); _agile_execute_web_rules();' ); } else{ if($domain){ wp_enqueue_script( 'main-js', 'https://'.$domain.'.agilecrm.com/stats/min/agile-min.js', array('jquery') ); wp_add_inline_script( 'main-js', '_agile.set_account("'.$js_api.'","'.$domain.'"); _agile_execute_web_rules();_agile.track_page_view();' ); } } }else{ if($webstats == $pagewebstats && $webrules == $pagewebrule){ wp_enqueue_script( 'main-js', 'https://d1gwclp1pmzk26.cloudfront.net/agile/agile-cloud.js', array('jquery') ); wp_add_inline_script( 'main-js', 'var Agile_API = Agile_API || {}; Agile_API.on_after_load = function(){_agile.set_account("'.$js_api.'","'.$domain.'"); _agile_execute_web_rules();_agile.track_page_view();};' ); } elseif($webstats == $pagewebstats){ wp_enqueue_script( 'main-js', 'https://d1gwclp1pmzk26.cloudfront.net/agile/agile-cloud.js', array('jquery') ); wp_add_inline_script( 'main-js', 'var Agile_API = Agile_API || {}; Agile_API.on_after_load = function(){_agile.set_account("'.$js_api.'","'.$domain.'"); _agile.track_page_view();};' ); } elseif($webrules == $pagewebrule){ wp_enqueue_script( 'main-js', 'https://d1gwclp1pmzk26.cloudfront.net/agile/agile-cloud.js', array('jquery') ); wp_add_inline_script( 'main-js', 'var Agile_API = Agile_API || {}; Agile_API.on_after_load = function(){_agile.set_account("'.$js_api.'","'.$domain.'"); _agile_execute_web_rules();};' ); } else{ if($domain){ wp_enqueue_script( 'main-js', 'https://d1gwclp1pmzk26.cloudfront.net/agile/agile-cloud.js', array('jquery') ); wp_add_inline_script( 'main-js', 'var Agile_API = Agile_API || {}; Agile_API.on_after_load = function(){_agile.set_account("'.$js_api.'","'.$domain.'"); _agile_execute_web_rules();_agile.track_page_view();};' ); } } } } add_action( 'wp_footer', 'agilecrm_campaigns_footer'); function agilecrm_campaigns_customfeautre_js() { $page = $_GET['page']; if($page != 'agilecrm_campaigns_settings'){ wp_enqueue_script('feautre',plugins_url('/js/inputsubmit.js', __FILE__),array('jquery') ); } } add_action( 'wp_enqueue_scripts', 'agilecrm_campaigns_customfeautre_js'); function agilecrm_campaigns_customsubmit_js() { wp_enqueue_script('formsubmit',plugins_url('/js/submitclassform.js', __FILE__),array('jquery') ); } add_action( 'admin_enqueue_scripts', 'agilecrm_campaigns_customsubmit_js'); function agilecrm_campaigns_custom_js() { //wp_enqueue_script('pubnub',plugins_url('/js/pubnub-3.4.min.js', __FILE__),array('jquery') ); //wp_enqueue_script('custom_script',plugins_url('/js/pubnub.js', __FILE__),array('jquery') ); } add_action( 'admin_enqueue_scripts', 'agilecrm_campaigns_custom_js'); function agilecrm_campaigns_hidedata_js() { wp_enqueue_script('hidedata',plugins_url('/js/hidedata.js', __FILE__),array('jquery') ); } add_action( 'admin_enqueue_scripts', 'agilecrm_campaigns_hidedata_js'); /*function agilecrm_campaigns_customrefresh_js() { $page = $_GET['page']; $get_domain = $_GET['domain']; if($page == 'agilecrm_campaigns_settings' && $_POST["save"]) { wp_enqueue_script('refresh',plugins_url('/js/refreshpage.js', __FILE__),array('jquery') ); } } add_action( 'admin_enqueue_scripts', 'agilecrm_campaigns_customrefresh_js'); function agilecrm_campaigns_get_customrefresh_js() { $page = $_GET['page']; $get_domain = $_GET['domain']; if($page == 'agilecrm_campaigns_settings' && $get_domain && $_POST["save"]) { wp_enqueue_script('refresh',plugins_url('/js/refreshpage.js', __FILE__),array('jquery') ); } } add_action( 'admin_enqueue_scripts', 'agilecrm_campaigns_get_customrefresh_js');*/ ?>