HTML Email Report Variables


#1

Hey everybody.

Just started using Piwik about a week ago and it’s awesome! Better yet, it auto sends HTML Reports! Awesome.

I’ve hit a wall though, and after literally 48 hours of trying different things and searching here/Google I’m hoping this forum of masters can help me.

(I only know HTML & CSS, for Javascript & PHP I have to try and reverse engineer everything with logic.)

I’ve set up a new skin for my HTML emails and what I’m trying to do now is “inject” (PHP style) the different forms of information into different sections of my template.

For instance:
My main focus is just getting the total visits value to show up where i want it to in the HTML. If I look in the html_report_body.tpl I can see that the visits summary table is all wrapped up into $reportRows. So the next logical step would be to find where $reportRows is broken down into the pieces so I could find just the total views variable. Theoretically I could put that in my HTML to have it render. After searching I can find the “array,” but nothing with the $ sign in front of it.

Basically, what I’m asking guys, is there a variable term I can put in the HTML to have it pull up and inject the total visits for the report? (I’m also looking for the $prettydate so I can rearrage the order it’s in. Still can’t find where the definition of it is!)

Thanks Guys.


(Matthieu Aubry) #2

To inject specific data into another content, please use the API: http://piwik.org/docs/analytics-api/reference/#VisitsSummary


#3

I don’t mean to be “that guy,” and I’m not lazy, but I’ve been staring at that page all morning. Could you fill in an example with something here? If I see one, I’ll instantly get it.

Example:

blah blah blah. it’s nice weather today. you have ****** page views from the previous month.

Thanks with the help, Matt.


(Matthieu Aubry) #4

There is a widget that does something a bit similar, see Example widgets > Forum visits maybe that will help?