Praćenje više WordPress autora sa Google Analytics

Google Analytics

Napisao sam još jedan post o tome kako pratiti više autora u WordPressu s Google Analytics jednom ranije, ali pogrešno ste shvatili! Izvan WordPress Loop-a ne možete uhvatiti imena autora, tako da kod nije radio.

Žao mi je zbog neuspjeha.

Dodatno sam iskopao i otkrio kako to pametnije učiniti s više profila Google Analytics. (Sasvim iskreno - to je kada volite profesionalce analitika paketi poput Webtrendovi!)

Korak 1: Dodajte profil postojećoj domeni

Prvi korak je dodavanje dodatnog profila na vašu trenutnu domenu. Ovo je opcija s kojom većina ljudi nije upoznata, ali savršeno odgovara za ovu vrstu scenarija.
postojeći-profil.png

Korak 2: Dodajte filtar za uključivanje u novi profil autora

Mjerit ćete samo prikaze stranica koje autori prate na ovom profilu, pa dodajte filter za poddirektorij / autor /. Jedna napomena u vezi s tim - morao sam da unesem „koji sadrže“ kao operater. Googleove upute pozivaju znak ^ prije mape. U stvari, ne možete upisati ^ u polje!
Include-author.png

Korak 3: Dodajte filter za izuzeće svom primarnom profilu

Nećete zapravo željeti pratiti sve dodatne prikaze stranica po autoru u originalnom profilu, pa dodajte filter originalnom profilu da izuzmete poddirektorij / autor-autor /.

Korak 4: Dodajte petlju u skriptu podnožja

U postojeće praćenje Google Analytics i ispod trenutne linije trackPageView dodajte sljedeću petlju u datoteku teme podnožja:

var authorTracker = _gat._getTracker ("UA-xxxxxxxx-x"); authorTracker._trackPageview ("/ po autoru / ");

Ovo će zabilježiti sva vaša praćenja, po autoru, u drugi profil za vašu domenu. Izuzimanjem ovog praćenja iz svog primarnog profila ne dodajete dodatne nepotrebne prikaze stranica. Imajte na umu da ćete, ako imate početnu stranicu sa 6 postova, pratiti 6 prikaza stranice s ovim kodom - po jedan za svaki post, praćen od autora.

Evo kako će izgledati praćenje autora na tom određenom profilu:
Snimak ekrana 2010 u 02 AM.png

Ako ste ovo postigli na drugačiji način, otvoren sam za dodatne načine praćenja podataka o autoru! Budući da je moj prihod od Adsensea povezan s profilom, čak vidim i koji autori generiraju najviše prihoda od oglasa :).

11 Komentari

  1. 1

    Great post Doug! An alternative for tracking Authors at this level is with event tracking in GA. You can get a tally of how many times each of your authors’ posts were viewed, in the same profile as your regular data, without inflating pageviews. Also, you can use multiple dimensions in the Event reporting to see what sources were driving visitors to various authors (e.g. who is attracting the most readers via Twitter), where they are coming from, etc. I tried to post the script, but I was over the character limit. Here is the link: http://www.wheresitworking.com/2010/02/08/tracking-authors-in-wordpress-with-google-analytics-event-tracking/

  2. 2
  3. 3

    Awesome, thanks for sharing this Doug! I’m finding that the_author() needs to be replaced with get_the_author() in order to prevent the author name being duplicated and outputted twice.

    Also, how does your solution compare with Adam’s?

  4. 4

    Doug, I tried to implement this, but it’s only tracking views of the actual author pages (…/author/AUTHORNAME), and not views of each post viewed, separated by author – any thoughts?

    • 5

      Hi Jeremy!

      The way I implemented it was actually utilizing two different accounts within Google Analytics (separate UA codes). I call one account “Author” and the other one I keep as the entire site. Make sense?

      Doug

  5. 7

    Thanks very much. I’m trying this out now. One thing though, I removed “echo” out of the loop because it seemed to be duplicating the author name. For instance /by-author/Author NameAuthor Name was appearing with the echo.

  6. 8

    Thanks for the tutorial. I need to track the pageviews each writer on a news blog accumulates in order to pay them by views.

    Including the homepage doesn’t really work, though.

    Can you just exclude code from the homepage? If that code was inserted only in the single-page layouts (an option on custom webpages), would that work? excluding homepage views from the count?

  7. 10

    How do you do step 1 please: “add an additional profile to your current domain”

    You show how to complete the step, but not how to get there in the first place.

Šta ti misliš?

Ova stranica koristi Akismet kako bi smanjila neželjenu poštu. Saznajte kako se podaci vašeg komentara obrađuju.