WordPress: Iji jQuery Mepee windo LiveChat site na ịpị njikọ ma ọ bụ bọtịnụ Iji Elementor

Iji jQuery imepe windo LiveChat site na ịpị njikọ ma ọ bụ bọtịnụ Iji Elementor

Otu n'ime ndị ahịa anyị nwere Elementor, otu n'ime ikpo okwu ụlọ akwụkwọ kacha sie ike maka WordPress. Anyị na-enyere ha aka ihichapụ mbọ ịre ahịa ha n'ime ọnwa ole na ole gara aga, na-ebelata nhazi nke ha mebere, yana na-eme ka sistemụ na-ekwurịta okwu nke ọma - gụnyere na nyocha.

Onye ahịa nwere LiveChat, Ọrụ nkata dị egwu nke nwere njikọ Google Analytics siri ike maka nzọụkwụ ọ bụla nke usoro nkata. LiveChat nwere API dị mma maka itinye ya na saịtị gị, gụnyere inwe ikike imeghe windo nkata site na iji mmemme onClick na mkpado arịlịka. Nke a bụ ka nke ahụ siri dị:

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

Nke a dị mma ma ọ bụrụ na ị nwere ike dezie koodu isi ma ọ bụ tinye HTML omenala. Ya na ElementorOtú ọ dị, a kpọchiri ikpo okwu n'ihi ihe nchebe ka ị ghara itinye ihe Pịa mmemme na ihe ọ bụla. Ọ bụrụ na ị nwere omenala onClick omume agbakwunyere na koodu gị, ị gaghị enweta ụdị njehie ọ bụla ... mana ị ga-ahụ koodu ahụ wepụrụ na mmepụta.

Iji jQuery Listener

Otu mmachi nke usoro onClick bụ na ị ga-edezi njikọ ọ bụla na saịtị gị wee tinye koodu ahụ. Usoro ọzọ bụ itinye edemede na ibe ahụ na-ege ntị maka otu pịa na ibe gị ma ọ na-emezu koodu maka gị. Enwere ike ime nke a site n'ịchọ nke ọ bụla arịlịka mkpado ya na otu ihe Klas CSS. N'okwu a, anyị na-akọwa mkpado arịlịka nke nwere klas aha ya openchat.

N'ime okpuru ala nke saịtị ahụ, m na-agbakwụnye naanị ubi HTML omenala yana edemede dị mkpa:

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

Ugbu a, edemede ahụ bụ saịtị n'obosara n'agbanyeghị ibe, ọ bụrụ na m nwere klas nke openchat nke a pịrị, ọ ga-emeghe windo nkata. Maka ihe Elementor, anyị debere njikọ ahụ na # yana klaasị dị ka openchat.

elementor njikọ

klaasị ntọala elementor dị elu

N'ezie, enwere ike ịkwalite koodu ma ọ bụ nwee ike iji ya mee ihe maka ụdị mmemme ọ bụla ọzọ, dị ka a Ihe nchịkọta Google Analytics. N'ezie, LiveChat nwere njikọ dị ịrịba ama na Google Analytics na-agbakwụnye ihe omume ndị a, mana m na-etinye ya n'okpuru ebe a dịka ọmụmaatụ:

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

Ime ụlọ na Elementor dị mfe ma ana m akwado ikpo okwu. Enwere nnukwu obodo, ọtụtụ akụrụngwa, yana ihe mgbakwunye Elementor ole na ole na-akwalite ike.

Malite na Elementor Malite na LiveChat

Ngosipụta: Ana m eji njikọ njikọta maka Elementor na LiveChat n'isiokwu a. Saịtị ebe anyị mepụtara ihe ngwọta bụ a Onye na-emepụta tub na-ekpo ọkụ na etiti Indiana.