HTML Form Submit Button Not Passing HTTP_Referrer Info - google-analytics

I was looking into my site's Google analytics code and realized that a a lot of pages that show up when my site visitor clicks on an html form submit button () are being logged as direct visitors.
Since these pages do not show up unless the visitor clicks on a form submit button, it is likely that the reason why these pages show up as the landing page for direct visit is because the referrer details are not being tracked.
Could someone help me out on how this can be fixed? Thanks in advance

Can't even begin to tell you why the referrer details are not being tracked, without you posting or pointing to any code.. but in general you can specify the referring URL with _setReferrerOverride()

Related

Cannot track a form submission with Google Tag Manager

I know the methods of tracking a form submission but in this case unfortunately I couldn't make it. Once the form is submitted, you can see in the debug mode that the exact same variables fire as in the case that the user tried to submit that form and it failed (because some fields weren't filled in). So the variables of GTM upon submitting don't help.
I tried another approach, with the url redirect. But the thing is that the redirection is to site.com/buy?add-to-cart, and this parameter causes adding to cart and then it redirects to the checkout page. This checkout page can be reached from many places so I can't track the form submission with page view either.
I don't know what to do already, is there another way that I didn't think of?
Thanks in advance

wordpress: Redirect homepage

The homepage of my Wordpress site is set to display my latest posts.
I also created a landing page which includes a form for users to fill out for a free consultation.
How can I make it so that when first-time users go to the homepage, they will be redirected to the landing page? (But clicking on my site logo should still take them back to my regular homepage showing my latest posts.)
After users have filled out the "get a free consultation" form on my landing page, we would create a cookie or something so that whenever they next visit the homepage, they will just see the regular homepage with latest posts - not see the landing page any more.
Is there a way to write a code for this?
Thanks in advance!!!
setcookie() is probably a good option.
if(!$_COOKIE["been_here_before"]) {
setcookie("been_here_before", true);
header('Location: /consultation'); // Your free consultation page
}
The way to achive this is a little bit more complicated.
The best practice for this is to have your form in an overlay on the homepage, the user sees the form when accessing your website but has an option to close that layer (exemple:"already fiiled the form..."). After the user submits the form or clicks "close" then set a session variable that will be used so the user won't receive the overlay again in that session. An website that does that is this one which asks the user to register for the newsletter. If the user is already register then he can click "Already registerd?" (=Sunteti deja înregistrat?) and the overlay disapears for that session.
If the form submision is mandatory for all users to get access to the website, then force them to login in the landing page. Here is an example for that.

Google Analytics in Wordpress - Cross-Domain Tracking

I've searched high and low for an answer for this problem and need the help of experts.
The website I'm helping to oversee has a registration in a frame on their main website. When a user visits the site, they can choose which course to take and click on a "Register" link to be taken to the externally hosted form.
I was able to get the GA tags changed on the framed pages, so that step is done.
However, I realise that in order to properly cross-domain track with Google Analytics, I need to also add an onclick event to any links that bring users to those pages, such as the example below.
Link
However, the site I'm working with is in Wordpress, and when I view the link in there it looks like this:
[iab_event link="http://www.EXAMPLESITE.com/course/4105/register.asp" text="Register"]
And when you view the page source of the live site this link is translated to this:
Register
I tried adding the second onclick event to the one above, but that didn't work. Is there any way to add the onClick="pageTracker._link('http://www.EXAMPLESITE.com/course/4105/register.asp'); return false;" to this link without breaking it?
Thank you in advance for any advice given!
Try stacking them in the onclick event like this:
Register
It should run all of the commands as long as they're separated by semi-colons.

Add goal in google analytics for a framed page

I have a page in ASP.NET C#, In my page I have iframe with another page. I want to add a Goal in Google analytics when people press the Submit-linkbutton in the framed page.
While my url doesnt change when I press the submit button I have heard that you can use the following javascript to tell Analytics that you´re on the specified page:
pageTracker._trackPageview('/booking.html');
So I have added the following line in the page_load function:
SubmitButton.Attributes.Add("onclick", "pageTracker._trackPageview('/booking.html');");
And in Google analytics have I added the goal url:
/booking.html
But nothing happends in the goal section when I press the submit button.
Im really not sure of what im doing so some help had been really appreciated.
Martin
Since iframes are treated as completely separate pages, I suspect you need to add the tracking code to the framed content as well.
You might also try calling a function in the parent page which triggers the page tracker:
SubmitButton.Attributes.Add("onclick", "parent.TrackPageView(window.location.href)");

Kentico CMS & Campaign Monitor

Just wondering if anyone has any pointers on how to integrate campaign monitor with Kentico CMS. Kentico has its own built in newsletter signup but I want campaign monitor to be updated when a user suscribes. I tried simply modifying the aspx page with a campaign monitor html form but when I try and submit an email address nothing happens.
When I view source kenitco is surrounding the page contentwith a form which I believe is affecting the CM form.
I have tried adding a static html page but the form action is somehow being modified to point to the active page instead of pointing to Campaign monitor subscription page.
Any help would be greatly appreciated.
I have solved this. The problem was that aspx pages do not allow you to submit a form other than to itself. I modified the template to be a asp page and it now serves the form fine.
This maynot be the best solution but works for me!

Resources