Kenya kopo ea Google Analytics Campaign Querystring ka matla u sebelisa jQuery

jquery

Friend Todd baker nthometse tharollo ka Twitter bakeng sa bothata boo nkileng ka ba le monyetla oa ho nts'etsapele tharollo ea bona. Kaha li-blog tsa rona tsa Compendium ka linako tse ling li tšoareloa sebakeng sa bobeli bakeng sa moreki, re ka rata ho fetisa Khoutu ea phutuho ea Google Analytics ho domain ea mantlha hore ba tsebe ho latela baeti ka nepo.

Bothata bo bong, leha ho le joalo, ke ho netefatsa hore li-blogger tsa hau li kenyelletsa khoutu ea phutuho… ho hong ho sa lebelloang. Tharollo e nepahetseng ke ho sebelisa JavaScript ho matlafatsa khoutu ea lets'olo ha leqephe le le ngata.

document.ready (mosebetsi () {
var campaignQueryString = '? {tlatsa sena ka}';
var targetDomain = '{tlatsa sena ka}';
$ ("a [href = 'http: // www." + targetDomain + "]'") ka ngoe (function () {
this.href + = letšoloQueryString;
});
});

Tharollo ena e khethehileng e sebelisa ebile e hloka jQuery, moralo o bulehileng oa JavaScript. Ke nna fan e kholo ea jQuery ho eketsa litlamorao tse ntle ho libaka tsa marang-rang . Ke utloile maikutlo ao baetsi ba bang ba likhoebo ba sa ananeleng ho leka ho tsamaisana le phetolelo, leha ho le joalo.

Haeba u sebelisa khoutu e kaholimo, u tlameha ho kenyelletsa jQuery. Ke khothaletsa ho e kenya ho tsoa ho Google. Kaha batho ba bangata ba etsa sena, leqephe la hau le tla jarisoa kapele haholo hobane khoutu e bolokiloe, kaha e ne e laetsoe pele.


Google e bile e fana ka Sehahi sa URL ho u bontša mokhoa oa ho haha ​​letšolo la hau la lipotso. Haeba u batla ho ba mabothobotho, ke khothaletsa ho kenyelletsa lintlheng tse kang mantsoe a bohlokoa, mekhahlelo, bangoli, jj.

ba fane ka tlhaloso e le 'ngoe

  1. 1

U nahana eng?

Sebaka sena se sebelisa Akismet ho fokotsa spam. Ithute kamoo litlhaloso tsa hau li hlahang kateng.