Skip to content

Python script that takes page view csv files (generated by Wordpress' Jetpack plug-in) and compiles the data into tables ready for your site analytics needs

Notifications You must be signed in to change notification settings

jessislearning/jetpack-monthly-views-csv-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Jetpack Monthly Views CSV Compiler

I'm currently the SEO Ninja 🥷 of SKKAW.BLOG. Even though the blog's page rank is already quite high for a lot of the posts, we've only recently begun our SEO optimization efforts. I wanted to track the effects on the site analytics from the Jetpack data (which has a longer history than the Google Site Kit (plus we're still configuring my remote access). I developed this code to compile the historical views data.

This is a Python script that compiles csv files of blog post views from Wordpress' Jetpack.
The wordpress website is under a Business Plan, equipped with Jetpack plug-in.

image

As there is currently no other way to download data except as to save them as csv files (link), I made a Python script that puts together data from all the downloaded csv files.

How it works:

  1. Make sure all csv files are saved in a target folder.

  2. image

  3. The Jetpack stats have no headers, has 3 columns corresponding to the post title, views and the URL.

  4. image

  5. The program creates a dataframe that will contain the relevant data.


  6. For every csv file, the program takes the month label from the filename and creates a new column that will contain the views of each post. The resulting dataframe will have the following columns: Post title (values: titles) and 1 month for every available file (values: views).


  7. The program outputs a csv file in a nested folder labeled "results". This is an example of the table that combines all the monthly views.

  8. image

  9. Additionally, if you are doing data analysis on the site analytics, the program also outputs the data into long format via pd.melt for easier data visualization with your tool of choice. It outputs a csv file labeled "tidy" in the results folder.

  10. image

    You can study your analytics easier:

    image

About

Python script that takes page view csv files (generated by Wordpress' Jetpack plug-in) and compiles the data into tables ready for your site analytics needs

Topics

Resources

Stars

Watchers

Forks

Languages