Automatically add tag when customer creates an account

Hi everyone,

I’m currently using the Spotlight Theme and want to achieve the following: When a vistor creates an account, the account should be tagged automatically with a tag ‘Samples’.

Online I’ve found a tutorial to do this by editting the code, but it says to add

underneath the line:

{% form ‘create_customer’ %}

in the Template-file “Customers/register.liquid”. The only problem is that I cannot find this file in my code. Below a picture to visualise this.

Anybody has an idea what I’m doing wrong here?

Thank you in advance!

Anyone has an idea why i cannot find Customers/register.liquid?

@Pavis

customers/register.liquid does not exist because Spotlight is an Online Store 2.0 theme.
The tutorial you found is for old (pre-OS 2.0) themes.

Below is the correct explanation and the exact way to implement auto-tagging in Spotlight

CORRECT way to auto-tag customers in Spotlight

You still use the same hidden input technique, just in the right file.

Step-by-step (works 100%)

Open the correct section

Go to:

Online Store → Themes → … → Edit code

Open:

Sections → main-register.liquid

Find the create customer form

Search inside the file for:

{% form 'create_customer' %}

You’ll see something like:

{% form 'create_customer', class: 'customer-form' %}

Immediately below that line, add:

<input type="hidden" name="customer[tags]" value="Samples">

:white_check_mark: Example:

{% form 'create_customer' %}
  <input type="hidden" name="customer[tags]" value="Samples">

  <!-- rest of the registration fields -->
{% endform %}

Thanks!