I have recently had to implement Adobe Analytics on our companies WordPress site. I wanted to write something up and of course give you the code to help others that will hit this road. All Adobe Analytics Implementations are custom. So this plugin is custom. So it is just meant to give you a good start on getting you going. I removed any company specific stuff in it but the big thing is to get the pagename and channel down. Since we have thousand of pages so an automated way was a must.
Here is a good article on pagename that I added logic from.
So this plugin includes the s_code then sets pagename and channel using some WordPress logic. Then I use Advanced Custom Fields ( you can use another plugin or write your own meta fields) to have pagename and channel override from the page level in the admin interface. Also used ACF to add a repeating rows of any custom tags we would want to put on that page.
It is important to notice that the include and the automated vars are hooked in after the opening body tag. I used genesis theme but you can hook it in to whatever theme you are using. If it is a good one it will have a hook for after the body tag. Then the actual s.t() call is hooked into the footer. This is for any more custom vars I would want to through in the page I could before the info was sent to adobe. If I had called the s.t() at the start and wanted to add I would then have to fire it again which would result in double counting.
Custom Plugin here:
Let me know if this helps you out?
Leave a Reply