Answer the question
In order to leave comments, you need to log in
How to write a value to a hidden field?
You need to write the value of " visitor_uid " to a hidden form field.
Where can I write the code below in Wordpress?
Functions.php , or in an html block on any Wordpress page?
How to correctly call this function to get the visitor_uid in the hidden form field?
<script type="text/javascript" id="amo_pixel_identifier_js" async="async"
src="https://piper.amocrm.ru/pixel/js/identifier/pixel_identifier.js"></script>
window.AMOPIXEL_IDENTIFIER_PARAMS = window.AMOPIXEL_IDENTIFIER_PARAMS || { } ;
window.AMOPIXEL_IDENTIFIER_PARAMS.onload = function (pixel_identifier) {
var visitor_uid = pixel_identifier.getVisitorUid ( ) ; // Получаем visitor_uid
console.log ( 'visitor_uid' , visitor_uid) ;
if (visitor_uid) {
// Записываем его в скрытое поле формы 'visitor_uid'
document.getElementById ( 'visitor_uid' ).value = visitor_uid;
}
} ;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question