I-WordPress: Ukusebenzisa i-jQuery Ukuvula Iwindi Le-LiveChat Ngokuchofoza Isixhumanisi noma Inkinobho Usebenzisa I-Elementor

Ukusebenzisa i-jQuery ukuvula iwindi le-LiveChat Ngokuchofoza Isixhumanisi noma Inkinobho Ukusebenzisa i-Elementor

Elinye lamakhasimende ethu linakho Elementor, enye yezinkundla eziqinile zokwakha ikhasi le-WordPress. Besilokhu sibasiza ukuba bahlanze imizamo yabo yokuthengisa engenayo phakathi nezinyanga ezimbalwa ezedlule, sinciphisa ukwenza ngokwezifiso abakusebenzisayo, futhi senze amasistimu axhumane kangcono - okuhlanganisa nezibalo.

Ikhasimende linayo LiveChat, isevisi yengxoxo emnandi enokuhlanganiswa okuqinile kwe-Google Analytics kuso sonke isinyathelo sengxoxo. I-LiveChat ine-API enhle kakhulu yokuyihlanganisa kusayithi lakho, okuhlanganisa ukuba nekhono lokuvula iwindi lengxoxo usebenzisa umcimbi we-OnClick kumaki we-anchor. Nansi indlela lokho kubukeka ngayo:

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

Lokhu kuyasiza uma unekhono lokuhlela ikhodi ewumongo noma wengeze i-HTML yangokwezifiso. Nge Elementor, nokho, inkundla ivaliwe ngenxa yezizathu zokuphepha ukuze ungakwazi ukwengeza i onClikha umcimbi kunoma iyiphi into. Uma unalowo mcimbi we-OnClick wangokwezifiso ongezwe kukhodi yakho, awutholi noma yiluphi uhlobo lwephutha… kodwa uzobona ikhodi isusiwe kokuphumayo.

Ukusebenzisa Umlaleli we-jQuery

Omunye umkhawulo wendlela ye-onClick ukuthi kuzomele uhlele sonke isixhumanisi esikusayithi lakho bese wengeza leyo khodi. Enye indlela yokwenza iwukufaka umbhalo ekhasini lokuthi lalela ngokuchofoza okuthile ekhasini lakho futhi ikwenzela ikhodi. Lokhu kungenziwa ngokubheka noma yikuphi ithegi yehange ngokukhethekile Ikilasi le-CSS. Kulokhu, siqoka ithegi yehange enekilasi eliqanjwe igama i-openchat.

Ngaphakathi kwaphansi kwesayithi, ngivele ngengeze inkambu ye-HTML yangokwezifiso enombhalo odingekayo:

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

Manje, leso script sibanzi sesayithi ngakho kungakhathalekile ukuthi yiliphi ikhasi, uma nginekilasi lalo i-openchat lokho kuchofoziwe, kuzovula iwindi lengxoxo. Okwento ye-Elementor, sisanda kusetha isixhumanisi ku-# kanye nekilasi njenge i-openchat.

isixhumanisi se-elementi

amakilasi ezilungiselelo ezithuthukisiwe

Kunjalo, ikhodi ingathuthukiswa noma ingasetshenziswa kunoma yiluphi olunye uhlobo lomcimbi, njenge-a Umcimbi we-Google Analytics. Yebo, i-LiveChat inokuhlanganiswa okuvelele ne-Google Analytics engeza le micimbi, kodwa ngiyifaka ngezansi njengesibonelo:

<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>

Ukwakha isiza nge-Elementor kulula kakhulu futhi ngincoma kakhulu inkundla. Kunomphakathi omkhulu, amathani ezinsiza, kanye Nezengezo ze-Elementor ezimbalwa ezithuthukisa amakhono.

Qala nge-Elementor Qalisa Nge-LiveChat

Ukudalula: Ngisebenzisa izixhumanisi ezihambisanayo ze Elementor futhi LiveChat kulesi sihloko. Isizinda lapho sithuthukise khona isisombululo yi-a Umkhiqizi we-Hot Tub enkabeni ye-Indiana.