• Status: Solved
  • Priority: Medium
  • Security: Private
  • Views: 68
  • Last Modified:

Capture campaign tag information for insert into database

Hello experts,

The basics of the problem is this.  I'm using a campaign tag to track interest in our degree program in Google Analytics.  I have a call to action button that collects basic demographic information.  I would like the button to also collect campaign information that is part of URL.  However, the CTA button is not usually the first thing clicked on.  So the person may navigate to another page on the site and then click the button.  By that time the link has changed and I've lost the important campaign data within the URL.  I realize that Google Analytics is able to track that information throughout a session.  Is there a way for me to track it this info within the session and submit it along with the other user enter information into my database?  I've attached a pic, it may be helpful

Thanks
Capture.PNG
0
wsom-itg
Asked:
wsom-itg
  • 2
  • 2
1 Solution
 
Lucas BishopClick TrackerCommented:
From a very high level, this is the basic process you'd want to build:

1.) Using jquery (ex parsequery) you'd capture the campaign id out of the URL upon initial visit
2.) You'd store the utm_campaign code in a cookie (jquery-cookie). This way even if they navigate from the initial page, or even leave the site, the campaign id is stored
3.) On any CTA button, you'll setup a hidden form field that is populated with the campaign id stored in the cookie, which submits the campaign id into their db record
0
 
wsom-itgAuthor Commented:
Thanks Lucas.  Would I need to use parsequery on every page of the site?  The site is very large.  Are there any consequences of doing this?
0
 
Lucas BishopClick TrackerCommented:
You would need the parse functionality and cookie creation on any page where you'd want to capture the url paramater. Basically all of your landing pages.
0
 
wsom-itgAuthor Commented:
We were able to get it working.  Thanks
0

Featured Post

Sign your company up to try the MB 660 headset now

Take control and stay focused in noisy open office environments with the MB 660. By reducing background noise, you can revitalize your office and improve concentration.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now