[amocrm id="123" hash="x7w3w3"]. This code is available to copy and paste directly from the amoCRM forms editor.
Version: 1.0
Author: amoCRM
Author URI: http://amocrm.com
*/
function createAmocrmEmbedJS($atts, $content = null) {
extract(shortcode_atts(array(
'id' => '',
'hash' => '',
), $atts));
if (!$id or !$hash) {
$error = "
Oh no!
Something is wrong with your amoCRM shortcode. Please, check it out and try again.
";
return $error;
} else {
/**
* Return embed JS
*/
$JSEmbed = '';
$JSEmbed .= '';
return $JSEmbed;
}
}
function utm_cookies(){
if (stristr(get_locale(), 'ru')) {
$script = 'https://forms.amocrm.ru/forms/assets/js/ga_utm_cookies.js';
} else {
$script = 'https://forms.amocrm.com/forms/assets/js/ga_utm_cookies.js';
}
wp_enqueue_script( 'utm_cookies', $script);
}
add_shortcode('amocrm', 'createAmocrmEmbedJS');
add_action('init', 'utm_cookies');
?>