WordPress: Kushandisa jQuery Kuvhura Hwindo reLiveChat Nekudzvanya Link kana Bhatani Uchishandisa Elementor.

Uchishandisa jQuery kuvhura Window yeLiveChat Nekudzvanya Link kana Bhatani Uchishandisa Elementor

Mumwe wevatengi vedu ane Elementor, imwe yeakanyanya kusimba mapeji ekuvaka mapuratifomu eWordPress. Isu tanga tichivabatsira kuchenesa kushambadzira kwavo mukati memwedzi mishoma yapfuura, tichidzikisa magadzirirwo avakaita, uye kuita kuti masisitimu ataure zvirinani - kusanganisira neanalytics.

Mutengi ane LiveChat, inonakidza yekutaura sevhisi ine yakasimba Google Analytics yekubatanidza kune yega nhanho yekutaura maitiro. LiveChat ine API yakanaka kwazvo yekuisanganisa nesaiti yako, kusanganisira kugona kuvhura hwindo rekutaura uchishandisa onClick chiitiko mune anchor tag. Heino maitiro ayo anotaridzika:

<a href="#" onclick="parent.LC_API.open_chat_window();return false;">Chat Now!</a>

Izvi zvinoshanda kana iwe uchikwanisa kugadzirisa kodhi kodhi kana kuwedzera tsika HTML. With Elementor, kunyange zvakadaro, chikuva chakakiyiwa pasi nekuda kwezvikonzero zvekuchengetedza kuti urege kuwedzera onClick chiitiko kune chero chinhu. Kana iwe uine iyo tsika paClick chiitiko chakawedzerwa kune yako kodhi, iwe hauwane chero mhando yekukanganisa… asi iwe uchaona iyo kodhi yakabviswa kubva pane yakabuda.

Kushandisa jQuery Muterere

Imwe yekumisikidza yeonClick nzira ndeyekuti iwe unofanirwa kugadzirisa yega yega link pane yako saiti uye wowedzera iyo kodhi. Imwe nzira ndeyekusanganisira script mupeji iyo anoteerera yekudzvanya pane peji rako uye inokuitira iyo kodhi. Izvi zvinogona kuitwa nekutsvaga chero anchor tag ine yakatarwa CSS kirasi. Mune ino kesi, isu tiri kugadzira anchor tag ine kirasi ine zita openchat.

Mukati mepasi pesaiti, ini ndinongowedzera tsika yeHTML ndima ine inodiwa script:

<script>
document.addEventListener("DOMContentLoaded", function(event) {
  jQuery('.openchat a').click(function(){
    parent.LC_API.open_chat_window();return false;
  });
});
</script>

Zvino, iyo script inzvimbo yakakura saka zvisinei nepeji, kana ndine kirasi ye openchat iyo yadzvanywa, ichavhura iyo chat hwindo. Kune iyo Elementor chinhu, isu tangoisa chinongedzo ku # uye kirasi se openchat.

elementor link

elementor advanced settings makirasi

Ehe, kodhi inogona kukwidziridzwa kana inogona kushandiswa kune chero imwe mhando yechiitiko zvakare, senge a Chiitiko cheGoogle Analytics. Ehe, LiveChat ine kusanganisa kwakasarudzika neGoogle Analytics iyo inowedzera zviitiko izvi, asi ini ndiri kuisanganisira pazasi semuenzaniso:

<script>
document.addEventListener("DOMContentLoaded", function(event) {
  jQuery('.openchat a').click(function(){
    parent.LC_API.open_chat_window();return false;
    gtag('event', 'Click', { 'event_category': 'Chat', 'event_action':'Open','event_label':'LiveChat' });
  });
});
</script>

Kuvaka saiti kunze neElementor kuri nyore uye ini ndinokurudzira zvikuru chikuva. Kune nharaunda huru, matani ezviwanikwa, uye akati wandei maElementor Add-Ons anosimudzira kugona.

Tanga neElementor Tanga neLiveChat

Kuzivisa: Ndiri kushandisa zvakabatana zvinongedzo zve Elementor uye LiveChat muchinyorwa chino. Nzvimbo yatakagadzira mhinduro ndeye Inopisa Tub inogadzira pakati peIndiana.