Referral Tracking Links

Square uses unique cookie links to attribute traffic from your websites and apps back to you. Setting up these links allows Square to attribute traffic to your company and provide you with credit for new merchants you have referred to Square.

Important

Please make this required update to ensure the Square links on your website, marketing initiates, and in-app OAuth flow are set up.

All of your referral tracking links to Squareup.com need to use the following tracking templates as appropriate:

Link to section

General Square link template

For any web pages where you promote Square or to sign up for a Square account, please use the following U.S. sign up link:

https://squareup.com/t/cmtp_performance/pr_developers/d_partnerships/p_{{account_id}}

Replace {{account_id}} with the account ID provided in your onboarding emails from Square. If you have not yet received this or you need additional sign-up links for other countries, please contact support.

After you update the link, it should look like this example:

https://squareup.com/t/cmtp_performance/pr_developers/d_partnerships/p_0014W000033PK54QAG

If you are linking to your app listing then add /?route={{your_app_listing_url}} after the account ID parameter. The following example shows a tracking URL that links to a seller's online store page:

https://squareup.com/t/cmtp_performance/pr_developers/d_partnerships/p_0014W000033PK54QAG?route=/online-store/sell-now
Link to section

OAuth links template

Follow the OAuth links template modify your OAuth URL to add tracking parameters. The existing OAuth URL segments and parameters are appended to the end of the template as the value of the route parameter.

Find the first OAuth link that you present in-product to connect sellers to your integration and update your (in-app) OAuth links with the following steps.

  1. Remove 'connect.' - If your OAuth link starts with connect.squareup.com, you need to remove connect. when adding the referral tracking parameters.
  2. Add a parameter - t/cmtp_performance/pr_cross_product/d_partnerships/p_{{account_id}}/cn_oauth/?route= The parameter is placed between the host Squareup.com/ and oauth2 in your existing OAuth link. oauth2 and the existing URL parameters become the value of the new ?route= parameter.

There are multiple variations of valid Square OAuth URL. The one that you currently use may not be the URL variation that these instructions assume. If so, simply modify your OAuth URL to match the Updated OAuth URL.

Link to section

Original OAuth URL

This is an example of the OAuth URL used to start the OAuth flow on the Square platform:

https://connect.squareup.com/oauth2/authorize?client_id=sq0ids-D-z5fkfkrbkdvwNZ-DdurA&scope=CUSTOMERS_WRITE+CUSTOMERS_READ&session=false&state=82201dd8d83d23cc8a48caf52b
Link to section

Updated OAuth URL

The following template shows a complete OAuth URL with referral tracking parameters, customer read/write permissions, and a state parameter:

https://squareup.com/t/cmtp_performance/pr_cross_product/d_partnerships/p_{{account_id}}/cn_oauth/?route=oauth2/authorize?client_id={{your_app_id}}&scope={{oauth_scopes}}&session=false&state={{session_state_value}}

When you create your OAuth URL, replace {{account_id}}, {{your_app_id}}, {{oauth_scopes}}, and {{session_state_value}} with actual values. The following example show an OAuth URL with referral tracking parameter values:

https://squareup.com/t/cmtp_performance/pr_cross_product/d_partnerships/p_0014W000033PK54QAG/cn_oauth/?route=oauth2/authorize?client_id=sq0ids-D-z5fkfkrbkdvwNZ-DdurA&scope=CUSTOMERS_WRITE+CUSTOMERS_READ&session=false&state=82201dd8d83d23cc8a48caf52b

Note

Your unique account ID is assigned by Square. It is to be embed into your link and provided to you as part of your onboarding emails. If you have not yet received the ID, please contact support.