Chapter 10 - Odoo 15 Development Book

Manage SEO Options

The Search Engine Optimization (SEO) is that the process of optimizing your website or webpage to extend the ranking and traffic in search engines like Google For getting more visitors to your company website, you must need a decent SEO, and therefore the Odoo platform provides you the assorted SEO supporting options, and this could be configured within the settings menu of the website module. Built-in SEO support for Odoo templates like web pages. Some templates are used with multiple URLs. As an example, in a web store, product pages are rendered using identical templates and different product records. In such cases, each URL requires different SEO options. Under the SEO tab, you can see a number of options and enable Google Analytics, and the console Google Look for better SEO integration. You will now be ready to see the SEO optimization option on your website. You can access it in the Optimize SEO menu under the Promote option. You will get an SEO dialog from the Promote drop-down menu at the top, as shown in the image below:

odoo-development-book

You can perform the operations by selecting the Optimize SEO menu. The Web Page Title and outline may be provided. The search engines are uses this information to market your website. Then you'll be able to allocate the Keyword. These keywords are the search keys that you simply want to steer to your website. you'll also select a picture for social share.

To enable SEO on each record of the model, you will need to inherit the website.seo.metadata mixin in your model. This will add a few fields and methods to your model. These fields and methods will be used from the website to store separate data for each record on your module.

class YourModule(models.Model):
    _name = your.model
    _inherit = ['website.seo.metadata']
    name = fields.Char(Name, required=True)
    date = fields.Date('Date')

If you want to see fields and methods for the SEO mixin, search for the website.seo.metadata model in the /addons/website/models/website.py file. All SEO-related code is written in the website.layout, and it gets all the SEO meta-information from the recordset passed as main_object. Since we passed a record object with the main_object key, the layout of the website will get all the SEO information from the given record. If you do not pass the main_object from the controller, the template record set is entered because of the main_object, which is why you get the identical SEO data on all records.

http.route('/url/', type='http', auth="user", website=True)
def your_demo_function(self, record):
    return request.render(
        your_model.your_template, {
            record: record,
            'main_object': record
        })

In Odoo, you can add custom metatags for Open Graph and Twitter sharing. If you want to add your custom metatags to a page, you can override _default_website_meta() after adding the SEO mixin.

def _default_website_meta(self):
    res = super(YourModel, self)._default_website_meta()
    res['default_opengraph']['og:image'] = self.env['website'].image_url(self, 'image')
    res['default_twitter']['twitter:image'] = self.env['website'].image_url(self, 'image')
    return res

After this, the record cover will be displayed on social media when you share the record's URL. Alternatively, you can set the page title and description in the same way. Update the module and change SEO to different record pages. This can be changed via the Optimize SEO option. Now, you can manage SEO details separately for each record.

Visitor information

The Visitor information is the information of website visiting persons. The details are stored on the backend of the website. Go to the website > visitors > visitors.

We can see a kanban view of all website visitors with some information like name status, active or inactive, number of visits, etc.

odoo-development-book

Using the icon in the top-right position, you can change the view to a List view or a Graphical view, depending on your needs. Filters and Group By options in Odoo will allow you to categorize and arrange your website visitors.

You'll be able to contact the visitor via SMS and email if you save their contact information in your system.

Just click one of that records and open a form view of the record.

odoo-development-book

In this, we can see the visitors' information and visits. Visitors' fundamental information, such as associated partner, email, language, cell phone, and so on, can be found on the visitors' information form. On the visits group, we can see the information about visiting the website like first connection date, last connection, visited pages, visited products, etc.

Also, we can get the information on visited pages on how many times a page will be visited, and product views also can find whether the particular person is now connected or not.

whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message