With the function of Google Analytics, you can set the index of the website by setting goals such as "member registration", "content registration", and "viewing 5 pages or more". I also set goals on my website (https://www.mini4wg.com/), so I will explain the setting items and implementation methods.
Templates are prepared and it is very convenient. If you specify google analytics, you can also modify the site to support diagrams. However, depending on the screen transition etc., it may be necessary to prepare for the conversion tag.
The first goal is --Revenue --Attracting customers
The goal description sets the type of measurement. --Arrival page --Stay time --Number of page views --Event Can be set.
The form here will change depending on the type set in the goal description (2/3). If you select an event, you need to send an event from your website. The arrival page, staying time, and page view can be used simply by setting from the Google Analyticw screen.
My site also has a function to register images, but when I want to send it only once at the time of creation to measure conversion, I implemented it as follows.
ProductsController
ruby
class ProductsController < ApplicationController
=abridgement=
def create
@product = current_user.products
.build(product_params)
authorize @product
if @product.save
flash[:cv] = true
redirect_to @product, notice: t('.saved')
else
render :new
end
end
=abridgement=
end
views/products/show.html.slim
slim
~~abridgement
- if flash[:cv] == true
javascript:
gtag('event', 'created', { 'event_category': 'products', 'event_label': '#{@product.id}'});
~~abridgement
You can see what kind of event is being sent by inserting the following Chrome Extension to see if the event is actually being sent.
Page Analytics (by Google) --Chrome Web Store https://chrome.google.com/webstore/detail/page-analytics-by-google/fnbdnhhicmebfgdgglcdacdapkcihcoh/related?hl=ja
By setting goals, it is very useful to have indicators to help improve the site and explain to others.