I wanted to compare 2 different wordpress themes.
I’m using a plugin called SES theme test or something like that and it swaps between 2 themes so I den test them. But I need to set up analytics to gather the data as follows:
1. Set up google analytics to look for custom variables.
Firstly go to your analytics interface and click on the ‘Admin’ tab (blue) then on the ‘Properties Settings’ (here it’s selected – orange.
Now go down and click on ‘Custom Definitions’ (above) then on Custom Dimensions (below.)
Then click on ‘New Custom Dimension’ button
Then fill in the ‘Name’, i just entered ‘theme name’. It’s just for your own reference.
It will then show you the code to add to your theme:
STEP 2, add code to theme
REplace ga(‘send’, ‘pageview’);
with:
ga(‘send’, ‘pageview’, {
‘dimension1′: ‘get(‘Name’) ?>’
});
Now analytics will pick up the theme name.