Open PeteHaK opened 6 years ago
@JackHaK
Apologies for radio silence, I've been developing a large chunk of the non integration tier dependent website so that my colleague can get on with skinning it all.
In the meantime have you had any joy with integrating the above?
Welcome back - we've not looked at it cos we hadn't heard anything from you and wwe were waiting for some direction as to where you wanted to focus next. Jack has now started a new role so things will be a bit less responsive so if you can start queueing up the things you need then I can get them done.
The issue with the Google Analytics integration is that we have no concept of a web page and no URL for the course. We can store the URL and integrate but you need to work out whether you are interested in events or courses. i.e if I'm looking at a course on a particular date is that a different page to looking at the generic course. People are more likely to be looking at Events than Courses. Can you discuss with Josh.
@PeteHaK
No worries, totally understand re: Jack's new role. I will start adding more issues here over the course of the next couple of days. There is plenty of other development work to be done on the website whilst they're being queued up.
As regards the concept of Events and Courses I totally agree with you this needs clarification from our end - we only want bookable instances to appear in the website ( for simplicity of presentation to the end user on the website Events and Courses would be referred to as Courses )
With this in mind I'm going to discuss this further with Josh then go through the current site and provide an example of how each of the following should be presented as bookable instances within the Integration Tier:
hasMany
courses )hasMany
events )hasMany
sessions ) <-- BookableGetting back to the Google Analytics integration the course URL definition of the new website it will be of the following structure:
/courses/{{ categorySlug }}/{{ courseSlug }}/{{ courseId }}
I don't see any benefit in including a course sub category in the URL structure, although if this is deemed necessary then it could be included.
As regards Laravel development this can be implemented via a mutator in the Course model as follows:
public function getUrlAttribute()
{
return '/courses/' . $this->category->slug . '/' . $this->slug . '/' . $this->id;
}
...which would be used to return unique page views for the new Course URL structure when published to production
as follows:
/**
* Get Page Path Filter.
*
* @param HumbleAndKind\Courses\Models\Course $course
*
* @return string
*/
protected function getPagePathFilter($course)
{
return env('APP_ENV') === 'production' ? 'ga:pagePath%3D~%5E' . $course->url . '/' : 'ga:pagePath%3D~%5E/courses/';
}
...but return unique page views for https://www.gta.gg/courses/ in the meantime. I would use the same mutator in the frontend of the website for the generation of sitemap.xml
, etc, etc, in order to ensure that all is in sync.
EXAMPLE CLASS FOR CALLING GOOGLE ANALYTICS IN ORDER TO RETRIEVE COURSE PAGE VIEW COUNT
The below is an example class taken from another website where similar functionality was required.
The following parameters would need to be stored in ENV:
GOOGLE_CLIENT_API_KEY
GOOGLE_CLIENT_PROFILE_ID
Google API Client can be installed via composer:
GOOGLE_CLIENT_API_KEY
GOOGLE_CLIENT_PROFILE_ID