Faka isicelo se-Google Analytics Campaign Querystring ngamandla usebenzisa i-jQuery

jquery

Friend UTodd Baker ungithumele isixazululo nge Twitter ngenkinga engingazange ngibe nethuba lokwenza isisombululo sayo. Njengoba amabhulogi ethu ku-Compendium kwesinye isikhathi ebanjelwa iklayenti esizindeni sesibili, singathanda ukudlula Ikhodi yomkhankaso we-Google Analytics kusizinda esiyinhloko ukuze bakwazi ukulandelela izivakashi ngempumelelo.

Obunye ubunzima, nokho, ukuqinisekisa ukuthi ama-blogger akho afaka njalo ikhodi yomkhankaso… okuthile okungafanele kulindelwe. Isixazululo esifanele uku sebenzisa iJavaScript ukufaka ngamandla ikhodi yomkhankaso lapho ikhasi lilayisha.

document.ready (umsebenzi () {
var campaignQueryString = '? {gcwalisa lokhu}';
var targetDomain = '{fill this in}';
$ ("a [href = 'http: // www." + targetDomain + "]'"). ngamunye (function () {
lokhu.href + = campaignQueryString;
});
});

Lesi sixazululo esithile sisebenzisa futhi sidinga i-jQuery, uhlaka lomthombo ovulekile lweJavaScript. Ngingu fan omkhulu we-jQuery ukufaka eminye imiphumela emihle kumasayithi e-web . Ngizwile impendulo ukuthi abanye onjiniyela bebhizinisi abakwazisi ukuzama ukuhambisana nokwenza inguqulo, noma kunjalo.

Uma usebenzisa le khodi engenhla, kufanele ufake i- jQuery. Ngingancoma ukuthi uyilayishe kusuka ku-Google. Njengoba abantu abaningi bekwenza lokhu, ikhasi lakho lizolayisha ngokushesha okukhulu njengoba ikhodi igcinwe kunqolobane, isalayishiwe ngaphambili.


IGoogle ize inikeze ngefayela le- Umakhi we-URL ukukhombisa ukuthi uwakha kanjani umbuzo wakho womkhankaso. Uma ufuna ukuthanda ngempela, ngincoma ukungeza ezintweni ezinjengamagama angukhiye, izigaba, ababhali, njll.

One comment

  1. 1

UCABANGANI?

Le sayithi isebenzisa i-Akismet ukunciphisa ugaxekile. Funda ukuthi idatha yakho yokuphawula isetshenziswa kanjani.