APIs & Integrations

AJGagathos
Member

Verify domain ownership for Google Analytics using analytics.txt method

@Derek_Gervais @IsaacTakushi @cbarley Hello! I'm currently working on getting access to my company's legacy google analytics account (no one at my company can figure out who the admin is to add me a user) with the google adwords support team.

 

we already have a tracking ID configured to our HubSpot account but adwords support is telling me to edit the source code to add analytics.txt to our website URL while they work on getting me access to the actual google analytics account. 

 

After chatting with Haley from HubSpot customer support she suggested I connect with you guys and believes adding the analytics.txt to our URL would be a first step, but it sounds like we also need to add a code snippet in the source code of the page to be able to track the data in the meantime. Would you be able to take a look and let me know what I can self serve from my end, or if a HubSpot developer would need to assist with the updates? Thanks so much! 

6 Replies 6
WendyGoh
HubSpot Employee
HubSpot Employee

Verify domain ownership for Google Analytics using analytics.txt method

Hey @AJGagathos,

 

Jumping in to provide some context.

 

To start, could you clarify if by adding analytics.txt, are you looking to add your Google Analytics code onto your HubSpot pages? If so, I'd love to share with you this detailed documentation - Add your Google Analytics code to your HubSpot pages or blog

 

If I completely misunderstood your point, please do not hesistate to elaborate further the use of the analytics.txt so that I can better guide you to the right direction.

0 Upvotes
AJGagathos
Member

Verify domain ownership for Google Analytics using analytics.txt method

Hi @Wendy thanks for following up. Yes I've read that article you provided as well as others. My situation is a bit different than starting from scratch since I'm taking over a legacy Google Analytics account that my company has set up and already synced with HubSpot. Unfortunately, no one at my company has the login details to add me as a user to the existing Google Analytics account so I'm working with Google AdWords to get this sorted. In the meantime, Google AdWords have instructed me to add the "analytics.txt" to our company's URL, which is different than the google tracking codes I believe.

I wasn't at the company when the website was launched with HubSpot and Google Analytics so I'm just trying to backtrack and make sure that everything for Google Analytics was set up correctly. Also to get myself access plus I've never used HubSpot before this, but I'm not a developer by trade so I'm limited on my code knowledge and how to troubleshoot.

 

Does that clarify my situation a bit better? Is there any more information I can provide at this stage? Thanks for your help! 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Verify domain ownership for Google Analytics using analytics.txt method

Hey @AJGagathos,

 

Researching into this further, I unfortunately didn't manage to gather much information on how to add analytics.txt on to pages. Based on my knowledge, I'm suspecting that the Google Analytics text that Google mentioned is a piece of javascript text which can be inserted on the <head> tag. An example: How To Set Up Your Website On Google Analytics (search for ' Google Analytics text').

 

However, just to ensure that this is the right direction, could you clarify with Google what does the analytics.txt file contain? So that I can best advise you on the next steps.

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Verify domain ownership for Google Analytics using analytics.txt method

Thanks for jumping in, @WendyGoh!

 

Hi, @AJGagathos, I agree with Wendy. Could you share Google's specific instructions with us?

 

From the limited context here, I believe they may be asking you to verify site ownership by placing a text file on the root of your domain (e.g. https://www.yourdomain.com/analytics.txt), similar to the methods outlined here.

 

Once we understand the exact purpose and details of the recommended action, we can confirm whether it's possible to accomplish in HubSpot with a proxy redirect or if we must explore alternatives.

Isaac Takushi

Associate Certification Manager
0 Upvotes
AJGagathos
Member

Verify domain ownership for Google Analytics using analytics.txt method

Screen Shot 2020-02-14 at 09.28.29.pnghere you go. yes what you outlined below makes sense Re: verification of site ownership. please let me know if you need anything else. thanks!! @IsaacTakushi @WendyGoh 

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Verify domain ownership for Google Analytics using analytics.txt method

Hi, @AJGagathos.

 

Thanks for your patience. I was out of the office yesterday for the Presidents' Day holiday.

 

To place a text file on the root of a HubSpot-hosted domain, we will need to employ a proxy redirect.

 

Please follow the steps below:

  1. Follow Google's instructions and create the analytics.txt file containing the prescribed string of text.
  2. Upload the file to your account's file manager.
  3. Copy the file's file URL.
  4. Create a HubSpot website page with the address https://www.example.com/analytics.txt. (Change www.example.com to the domain for which you must verify ownership. Repeat for all applicable domains.) See Screenshot 1 below.
  5. Create a proxy redirect from https://www.example.com/analytics.txt to the file URL. See Screenshot 2 below.
  6. After the redirect propagates, you should see the text file when you navigate to https://www.example.com/analytics.txt.
  7. Once completed, share the URL(s) with Google per the Next steps section of their email.

If, for some reason, this proxy redirect method does not satisfy Google's requirements (since the file is not truly hosted at the root of your site), please ask them if we can use any of these other methods to verify domain ownership.

 

Screenshot 1.jpgScreenshot 2.jpg

Isaac Takushi

Associate Certification Manager