Step 1: Set up Auto-Linking for Localmed.com
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 (localmed.com), 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', ['localmed.com']);
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:
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
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
In the Auto Link Domains field, enter localmed.com
To receive incoming links from localmed.com, navigate to More Settings and then Fields to Set and add a field with a Field Name of allowLinker and a Value of true
Save your changes and publish the container
Google Documentation:
Additional Info:
Step 2: Add a Referral Exclusion for Localmed.com
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 my-site.com goes to your-site.com, and then returns to my-site.com. If you do not exclude your-site.com as a referring domain, two sessions are counted, one for each arrival at my-site.com. If, however, you exclude referrals from your-site.com, the second arrival to my-site.com does not trigger a new session, and only one session is counted.
How to Add a Referral Exclusion
Sign in to your Analytics account
Click Admin in the bottom left corner of the screen
In the ACCOUNT column, use the dropdown to select the Analytics account that contains the property you want to work with
In the PROPERTY column, use the dropdown to select a property
Click Tracking Info
Click Referral Exclusion List
To add a domain, click +ADD REFERRAL EXCLUSION
Enter localmed.com in the Domain text box
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 localmed.com
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:
Sign in to Google Analytics.
Click Admin, and navigate to the view you want to copy.
In the VIEW column, click View Settings.
Click Copy view.
Give this new view a name. Use a distinct name so you can distinguish it from the original view.
Click Copy view.
3.2 Create a filter to display domain names
To create a view filter that displays domain names in your reports:
Sign in to Google Analytics.
Click Admin, and navigate to the view you want to add a filter to.
In the VIEW column, click Filters.
Click +ADD FILTER.
Select Create new Filter and type a descriptive name in the Filter Name text box.
Enter the settings shown below:
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:
On initial view/load
Category: LocalMed Appointment Action: Viewed LocalMed Widget Label: [None]
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]
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:
Sign in to Google Analytics.
Click Admin and navigate to the desired view.
In the VIEW column, click Goals.
Click +NEW GOAL.
Select Custom from the list of options.
Click Continue.
Enter a goal name, e.g. Scheduled LocalMed Appointment
Under Type, select Event.
Click Continue.
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 support@localmed.com 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.