AdWords
4.7K members online now
4.7K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

Capture Google Analytics User ID & Insert into SQL DataBase

Top Contributor
# 1
Top Contributor

I want to capture Google Analytics User IDs into our company's SQL database WITH the following information: UTM_Source / UTM_Campaign / UTM_Keyword / Goal Completion. 

 

Is this possible? If so, how? 

 

Thanks guys!

Joshua, Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’
2 Expert replyverified_user
3 ACCEPTED SOLUTIONS

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by Mini-CM (Community Manager)
September 2015

Re: Capture Google Analytics User ID & Insert into SQL DataBase

Top Contributor
# 3
Top Contributor
Hi Joshua R,

You provide the user id's for Analytics. There are a couple ways you can go about this.

First, make sure your URL's have been properly set up with manual tagging. You're going to need to be abl to do server-side scripting for this.

The UTM_* stuff only comes in with the original AdWords click. After that, the manual tagging data won't be available, so you need to store that data somewhere. If you are creating a user id for each visitor, you can create that user id now and save the UTM_* data to your db.

It doesn't look like that's what the user id is intended for. It's purpose is to identify users across multiple devices. The user id is assigned by you when they create an account. If they don't sign into an account, you have no way of knowing who the user is when they come back on a different device.

In this case, I'd probably read the UTM_* values and create a cookie to carry those values around until the visitor creates an account. At that time, you would read your own cookie (not Google's cookie), retrieve those values and save them in your db. At least that's how I do it. It works for me. I actually create the cookie with client-side Javascript. I read and store the cookie data on the server-side.

I would cross-reference this answer with what ever you get from the Analytics team.

Best of Luck!

Pete
petebardo -- Deadhead doing AdWords

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Joshua R
September 2015

Re: Capture Google Analytics User ID & Insert into SQL DataBase

Community Manager
# 4
Community Manager
Thanks for helping Joshua, Pete.

View solution in original post

Marked as Best Answer.
Solution
Accepted by Mini-CM (Community Manager)
September 2015

Re: Capture Google Analytics User ID & Insert into SQL DataBase

Top Contributor
# 6
Top Contributor
Hi Joshua,

The user id thing is new and I wasn't completely aware of it when I posted. You still need to so the same thing for your internal db records. What I didn't realize at the time is the the user id will be applied to the entire session, including page views before logging in. That's very useful.

You will still need to capture the click data on the landing page.

Pete
petebardo -- Deadhead doing AdWords

View solution in original post

Re: Capture Google Analytics User ID & Insert into SQL DataBase

Community Manager
# 2
Community Manager
Hi Joshua,

I have requested an Analytics technical specialist to help you with this.

Thanks for your patience as you wait,
Mini
Marked as Best Answer.
Solution
Accepted by Mini-CM (Community Manager)
September 2015

Re: Capture Google Analytics User ID & Insert into SQL DataBase

Top Contributor
# 3
Top Contributor
Hi Joshua R,

You provide the user id's for Analytics. There are a couple ways you can go about this.

First, make sure your URL's have been properly set up with manual tagging. You're going to need to be abl to do server-side scripting for this.

The UTM_* stuff only comes in with the original AdWords click. After that, the manual tagging data won't be available, so you need to store that data somewhere. If you are creating a user id for each visitor, you can create that user id now and save the UTM_* data to your db.

It doesn't look like that's what the user id is intended for. It's purpose is to identify users across multiple devices. The user id is assigned by you when they create an account. If they don't sign into an account, you have no way of knowing who the user is when they come back on a different device.

In this case, I'd probably read the UTM_* values and create a cookie to carry those values around until the visitor creates an account. At that time, you would read your own cookie (not Google's cookie), retrieve those values and save them in your db. At least that's how I do it. It works for me. I actually create the cookie with client-side Javascript. I read and store the cookie data on the server-side.

I would cross-reference this answer with what ever you get from the Analytics team.

Best of Luck!

Pete
petebardo -- Deadhead doing AdWords
Marked as Best Answer.
Solution
Accepted by topic author Joshua R
September 2015

Re: Capture Google Analytics User ID & Insert into SQL DataBase

Community Manager
# 4
Community Manager
Thanks for helping Joshua, Pete.

Re: Capture Google Analytics User ID & Insert into SQL DataBase

Top Contributor
# 5
Top Contributor
Hey Pete,

Thanks for the long and precise explanation. Your expertise was very helpful!
Joshua, Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’
Marked as Best Answer.
Solution
Accepted by Mini-CM (Community Manager)
September 2015

Re: Capture Google Analytics User ID & Insert into SQL DataBase

Top Contributor
# 6
Top Contributor
Hi Joshua,

The user id thing is new and I wasn't completely aware of it when I posted. You still need to so the same thing for your internal db records. What I didn't realize at the time is the the user id will be applied to the entire session, including page views before logging in. That's very useful.

You will still need to capture the click data on the landing page.

Pete
petebardo -- Deadhead doing AdWords