Step 1: Set up Auto-Linking for

Cross-domain tracking works by sharing a unique client ID between a source domain and a destination domain. To set up cross-domain auto-linking on the source domain (your website) for URLs pointing to the destination domain (, follow the steps below.

If You're Using analytics.js :

1. Find the create method call in your site's code:

ga('create', 'UA-XXXXXXX-Y', 'auto');

2. Make the following changes to require the linker plugin and call its autoLink method:

ga('create', 'UA-XXXXXXX-Y', 'auto', {'allowLinker': true}); ga('require', 'linker'); ga('linker:autoLink', ['']);

3. These changes must be made everywhere the create method call appears in your code.

Google Documentation:

If You're Using Google Tag Manager

To configure Tag Manager to measure user interaction across multiple domains:

  1. In Tag Manager, open your Google Analytics Settings variable or Universal Analytics tag for editing

    • To find your Google Analytics Settings variable, click Variables and then click the appropriate variable in the list

    • To find your Universal Analytics tag, click Tags and then select the appropriate tag in the list

  2. Navigate to More Settings and then Cross Domain Tracking

    Note: The preferred method is to make changes to the Google Analytics Settings variable, so that changes are shared across multiple tags. In Universal Analytics tags, click Enable overriding settings in this tag to expose the More Settings option

  3. In the Auto Link Domains field, enter

  4. To receive incoming links from, navigate to More Settings and then Fields to Set and add a field with a Field Name of allowLinker and a Value of true

  5. Save your changes and publish the container

Google Documentation:

Additional Info:

Step 2: Add a Referral Exclusion for

Referral traffic is the segment of traffic that arrives on your website through another source, like through a link on another domain. Analytics automatically recognizes where traffic was immediately before arriving on your site, and displays the domain names of these sites as the referral traffic sources in your reports.

How excluding referral traffic affects your data:

By default, a referral automatically triggers a new session. When you exclude a referral source, traffic that arrives to your site from the excluded domain doesn’t trigger a new session. If you want traffic arriving from a specific site to trigger a new session, don't include that domain in this table.

Because each referral triggers a new session, excluding referrals (or not excluding referrals) affects how sessions are calculated in your account. The same interaction can be counted as either one or two sessions, based on how you treat referrals.

For example, a user on goes to, and then returns to If you do not exclude as a referring domain, two sessions are counted, one for each arrival at If, however, you exclude referrals from, the second arrival to does not trigger a new session, and only one session is counted.

How to Add a Referral Exclusion

  1. Sign in to your Analytics account

  2. Click Admin in the bottom left corner of the screen

  3. In the ACCOUNT column, use the dropdown to select the Analytics account that contains the property you want to work with

  4. In the PROPERTY column, use the dropdown to select a property

  5. Click Tracking Info

  6. Click Referral Exclusion List

  7. To add a domain, click +ADD REFERRAL EXCLUSION

  8. Enter in the Domain text box

  9. Click Create to save

    Note: Your own domain should also be in the Referral Exclusion List (it was automatically added when you created the property), but if not, add your domain by following the same steps above and entering your domain instead of

Step 3: Set up a Reporting View and an Advanced Filter (Optional)

This allows you to distinguish LocalMed pages from your domain pages.

By default, Analytics only includes the page path and page name, not the domain name. For example, you might see your pages appear in the Site Content report like this:

  • /about/contactUs.html

  • /about/contactUs.html

  • /products/buy.html

Because the domain names aren’t listed, it might be hard to tell which domain each page belongs to.

To get the domain names to appear in your reports, you need to do two things: Create a copy of your reporting view that includes data from all your domains in it and add an advanced filter to that new view. The filter will tell Analytics to display domain names in your reports.

3.1 Create a Copy of a Reporting View

Because some Analytics features fundamentally alter how data is collected or processed in your account in ways that cannot be reversed, you should duplicate the original view before making changes. Always keep original views unchanged and add filters or other reporting features to the duplicate views. This lets you use the original view as the canonical source, or reference point, for all the data you’re collecting in that property and customize the other views to meet specific reporting needs.

How to copy a view:

  1. Sign in to Google Analytics.

  2. Click Admin, and navigate to the view you want to copy.

  3. In the VIEW column, click View Settings.

  4. Click Copy view.

  5. Give this new view a name. Use a distinct name so you can distinguish it from the original view.

  6. Click Copy view.

3.2 Create a filter to display domain names

To create a view filter that displays domain names in your reports:

  1. Sign in to Google Analytics.

  2. Click Admin, and navigate to the view you want to add a filter to.

  3. In the VIEW column, click Filters.

  4. Click +ADD FILTER.

  5. Select Create new Filter and type a descriptive name in the Filter Name text box.

  6. Enter the settings shown below:

  7. Click Save to create the filter

You can validate that filters are working as you expect using Google Tag Assistant Recordings. Tag Assistant Recordings can show you exactly how your filters change your traffic.

Google Documentation:

Blog post about creating a hostname filter:

Step 4: Create Goals for LocalMed Events

We send Google Analytics events from the widget at three points in the scheduling workflow:

  1. On initial view/load

    Category: LocalMed Appointment Action: Viewed LocalMed Widget Label: [None]
  2. When the patient views the appointment form (after selecting a time but before clicking Schedule Appointment)

    Category: LocalMed Appointment Action: Viewed LocalMed Appointment Form Label: [Provider ID]
  3. After clicking Schedule Appointment

    Category: LocalMed Appointment Action: Scheduled LocalMed Appointment Label: [Provider ID]

How to create a goal for the Scheduled LocalMed Appointment event:

  1. Sign in to Google Analytics.

  2. Click Admin and navigate to the desired view.

  3. In the VIEW column, click Goals.

  4. Click +NEW GOAL.

  5. Select Custom from the list of options.

  6. Click Continue.

  7. Enter a goal name, e.g. Scheduled LocalMed Appointment

  8. Under Type, select Event.

  9. Click Continue.

  10. Set Action equal to Scheduled LocalMed Appointment

Using these events and possibly your own events, you could create more complex additional goals if desired.

Google Documentation:

Step 5: Send LocalMed your Google Analytics Tracking ID

Once you have completed the above steps, send us your Tracking ID for us to implement in your widgets. Send an email to with the Tracking ID, Practice Name, and Office Name in the following format:

UA-XXXXXXX-Y Practice Name Office Name (if more than one office)

LocalMed's Side

On LocalMed's side, Adwords and/or Analytics tracking can be enabled by adding the Conversion ID & Label and/or Google Analytics Property (UA code) to a particular widget. This step has to be done by a LocalMed employee. An example of the configuration on our side is shown below. Each widget can be assigned different IDs/codes.

Google Adwords:

Did this answer your question?