JavaScript parameters

Use the following table of JavaScript parameters to populate the fields in your function.

Parameters
partnerId

string, Required

Your partner code. This should should have been given to you when you contacted Google Domains in Step 1.

successUrl

string, Required

The URL that you would like users to be returned to once they purchased their domain. This URL may contain any fields you pass into the function. This URL may append the name of the domain that was purchased, which will be a reserved variable provided by Google Domains as %domain%. Please note: this URL must use https protocol. Sample URL: "www.example.com/success?uid="+userId+"&domain=%domain%"

cancelURL

string, Required

The URL that you would like users to be returned to if there were any errors or cancellations during the purchase process. Users that fail to purchase a domain for any reason will be redirected to this URL. This field follows the same format as the successURL field. Please note: this URL must use https protocol.

defaultQuery

string, Optional

This field contains the default search query when the widget loads.

defaultTlds

string array, Optional

This is an array of top-level domains that will be set as the default filter options in search results. Example: ["com", "cc", "florist", "ninja"]

template

field, Conditionally required

This optional field contains information on which template you want to associate with the user. This field can be omitted if you do not have a template.

templateId

string, Conditionally required

The name of the template you want to use for this page. This should have been created during the setup of your template in Step 1. This field is required if you decide to use a template.

vars

string, Conditionally required

Any fields you wish to use in the template. These should be passed in key:value format, such as "blog_id" : "3". These fields should have been specified during the setup process in Step 1. Note that the widget self-destructs if the parameters passed in are different from those specified during setup. The variable %domain% is reserved and is automatically populated with the domain name purchased by the user, so you can use it in your resource records if necessary.

hints/additionalServices

field, Optional

This optional field contains other services you may want to offer to your customers. Currently, you may include G Suite, which offers custom email along with other services, into the registration flow by specifying '["email"]' under additionalServices.