?
SolvedPrivate

Capture campaign tag information for insert into database

Posted on 2015-01-26
4
Medium Priority
?
39 Views
Last Modified: 2016-02-24
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
Comment
Question by:wsom-itg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
Lucas Bishop earned 2000 total points
ID: 40572070
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
 

Author Comment

by:wsom-itg
ID: 40572882
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
 
LVL 18

Expert Comment

by:Lucas Bishop
ID: 40573394
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
 

Author Closing Comment

by:wsom-itg
ID: 40584539
We were able to get it working.  Thanks
0

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read this article and get to know some best tips for outsourcing client PPC work to a white label PPC agency.
We aren’t perfect, just like everyone else.  Check out the email errors our community caught and learn the top errors every email marketer should avoid.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question