Txuas Ntxiv Google Analytics Phiaj Los Nqis Lus Nug Querystring Dynamically siv jQuery

jquery

Cov phooj ywg Todd Baker xa tuaj rau kuv tov Twitter rau qhov teeb meem uas kuv tsis tau muaj txoj hauv kev los daws qhov teeb meem rau. Txij li thaum peb cov blogs ntawm Kev Sib Ntsib yog qee zaum tuav ntawm lub chaw thib ob rau tus neeg siv khoom, peb xav kom dhau Google Analytics kev sib tw code rau thawj tus sau yog li lawv tuaj yeem taug qab cov qhua zoo.

Lwm qhov nyuaj, txawm hais tias, los xyuas kom koj cov bloggers ib txwm suav nrog kev tawm phiaj los nqis tes ... ib yam dab tsi uas yuav tsum tsis txhob xav. Qhov tseeb uas yog rau siv JavaScript rau dynamically ntxiv phiaj los nqis tes code thaum nplooj ntawv loads.

cov ntaub ntawv.ready (muaj nuj nqi () {
var campaignQueryString = '? {sau no hauv}';
var targetDomain = '{sau qhov no rau hauv}';
$ ("a [href = 'http: // www." + targetDomain + "]'") txhua qhov (function () {
this.href + = campaignQueryString;
});
});

Cov kev daws teeb meem tshwj xeeb no siv thiab yuav tsum muaj jQuery, qhib lub hom phiaj qhib JavaScript. Kuv yog a kiv cua loj ntawm jQuery ntxiv qee qhov zoo rau hauv lub vev xaib Cov. Kuv tau hnov ​​cov lus tawm tswv yim tias qee cov neeg tsim kev lag luam tsis zoo siab rau kev sim ua nrog lub versioning.

Yog tias koj siv cov cai saum toj saud, koj yuav tsum suav nrog jQueryCov. Kuv xav kom nws thauj khoom ntawm Google. Txij li ntau tus neeg tau ua qhov no, koj cov nplooj ntawv yuav thauj khoom sai dua vim tias qhov chaws tau khaws cia, tau thauj khoom ua ntej.


Google tseem khoom siv a URL Builder los qhia koj yuav tsim koj txoj kev tshawb nrhiav phiaj xwm li casCov. Yog tias koj xav tau cov yeeb yam tiag tiag, Kuv xav qhia ntxiv hauv cov ntsiab lus xws li cov ntsiab lus, pawg, kws sau ntawv, thiab lwm yam.

ib saib

  1. 1

Yuav ua li cas koj xav hais tias?

Qhov Web site no siv Akismet los txo cov kev pabcuam. Kawm li cas koj cov ntaub ntawv tawm tswv yim tiav.