---
title: "Magento 2: How to Save Custom Attribute Value After Customer Register"
url: "https://magecomp.com/blog/magento-2-save-custom-attribute-value-customer-register/"
date: "2020-04-24T17:46:49+00:00"
modified: "2025-11-14T06:00:55+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 457
reading_time: "3 min read"
summary: "Hello Magento Folks?,
How are you all going on? Welcome again in our latest article of How To Series for Magento 2 where we are going to understand How to Save Custom Attribute Value After Customer..."
description: "I will explain to you about How to add a custom Attribute and save the value after the customer register Successful with the help of appropriate codes for it."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Get Quote Information using REST API in Magento 2"
    url: "https://magecomp.com/blog/get-quote-information-using-rest-api-magento-2/"
  - title: "How to Create Coupon Codes Programmatically in Magento 2"
    url: "https://magecomp.com/blog/how-to-create-coupon-codes-programmatically-in-magento-2/"
  - title: "Magento 2: How to Add Custom Validation Rule in knockout Validation Rules"
    url: "https://magecomp.com/blog/magento-2-add-custom-validation-rule-in-knockout-validation-rules/"
---

# Magento 2: How to Save Custom Attribute Value After Customer Register

_Published: April 24, 2020_  
_Author: Dhiren Vasoya_  

![How to Save Custom Attribute Value After Customer Register M2](https://magecomp.com/blog/wp-content/uploads/2020/04/How-to-Save-Custom-Attribute-Value-After-Customer-Register-M21-1024x512.webp)

**Hello Magento Folks?,**

How are you all going on? Welcome again in our latest article of **[How To Series for Magento 2](https://magecomp.com/blog/category/how-to-magento/)** where we are going to understand How to Save Custom Attribute Value After Customer Register Successful in Magento 2. Previously, we have learned about [**How to Check If Magento 2 is Running In Production Mode with all the required codes.** ](https://magecomp.com/blog/check-magento-2-running-production-mode/)

[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-5.webp)](https://magecomp.com/services/hire-magento-programmer/)

## Introduction
Basically, Magento 2 is very flexible to use and the development of your own attributes according to your requirements is easily created. Here, in this article, I will explain to you about How to add a custom Attribute and save the value after the customer register Successful with the help of appropriate codes for it. Let’s Get In?.
[![](https://magecomp.com/blog/wp-content/uploads/2022/05/Mobile-App.png)](https://magecomp.com/magento-2-mobile-app-builder)

## Steps to Code:
**Step 1:**

**Firstly, create app\code\Vendor\Extension\etc\frontend\events.xml**

```
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">

<event name="customer_register_success">

   <observer name="event_customer_register_success" instance="VendorExtensionObserverCustomerRegisterSuccessObserver" />

</event>

</config>
```

**Step 2:**

**Now create, app\code\Vendor\Extension\ Observer\Customer\RegisterSuccessObserver folder and add this code**:
```
<?php

namespace VendorExtensionObserverCustomer;

use MagentoFrameworkEventObserverInterface;

use MagentoCustomerApiCustomerRepositoryInterface;

class RegisterSuccessObserver implements ObserverInterface

{

    protected $customerRepository;

    public function __construct(

        CustomerRepositoryInterface $customerRepository)

    {

        $this->customerRepository = $customerRepository;

    }

    public function execute(MagentoFrameworkEventObserver $observer)

    {

        $customer = $observer->getEvent()->getCustomer();

        $customer->setCustomAttribute('iscustomattribute', 1);

        $this->customerRepository->save($customer);

        return $this;

    }

}
```

[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-6.webp)](https://magecomp.com/magento-malware-removal.html)

After performing the above step you can easily save your custom attribute on Customer Registration in Magento 2.
## Final Words:
I hope the above-given explanation about How to Save Custom Attribute Value After [Customer Register Successful in Magento](https://magecomp.com/magento-2-customer-approval.html) was helpful for all. For more articles like this do comment on your programmatically issues in Magento 2 in the comment section below. If you find any difficulties in performing the above steps then feel free to contact our[ Support Team](https://magecomp.com/support/). And if you find the blog interesting then do share with your Magento friends and help them.
[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-3.webp)](https://magecomp.com/magento-performance-optimization.html)

Stay Home? Stay Safe!
Happy Coding 🙂
[![Magento-development-services](https://magecomp.com/blog/wp-content/uploads/2020/06/Hire-Magento-4.png)](https://magecomp.com/magento-development-services?utm_source=magecomp&utm_medium=blog&utm_campaign=cta)

## FAQ

1. **What is a customer custom attribute in Magento 2?**

A customer custom attribute in Magento 2 refers to a separate field you can create to collect additional information from customers when they register or enter their account area. The most common examples are GST number, ID proof, company name, or membership type.

**2. Can I save multiple custom attributes during customer registration?**

Yes, you can have as many custom attributes as you want and save them all. Just ensure that you have configured the attributes, included them in the registration form, and then ensured that the observer handles all of those attribute fields.


---

_View the original post at: [https://magecomp.com/blog/magento-2-save-custom-attribute-value-customer-register/](https://magecomp.com/blog/magento-2-save-custom-attribute-value-customer-register/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-09-27 06:23:06 UTC_  
