Hi
I've got a site with some modal pop up windows that display after a user clicks a button. I'd like to track a page-view for this when the page displays. The page is a sign-up form for registering with the site as well as a follow-up email verification page. Any help is appreciated here.
Solved! Go to Solution.
Views
Replies
Total Likes
Assuming you're not talking about a whole new page/window, and in fact a dynamic modal window that would not lend itself to adding the standard analytics code, you can just use the s.t() directly to "fire" a page view when the modal opens. We have done this many times. Let me know if you have any questions!
Views
Replies
Total Likes
Hi Brad,
You can implement the analytics code on the sign up page that comes as a modal pop up. This sign up page may be an html page, so you can implement the analytics variables at the page level and call the core js file (s_code.js).
You can use the jquery colorbox plug in.
At the page where you have the button/link to that modal window (the sign up page), just place this code just before </head> tag:
<link rel="stylesheet" href="colorbox.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="jquery.colorbox.js"></script>
<script>
$(document).ready(function(){
//Examples of how to assign the Colorbox event to elements
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
});
</script>
Then add the href code with iframe to call your "Sign Up" page (The Modal Window) anywhere in the <body> tag, like this:
<a class='iframe' href="signup.htm">Sign Up</a>
You can see an example using Google Chrome web browser at the following test site:
http://analyticsawesomeness.bugs3.com/
Look at the page source for the code and "jquery.colorbox.js" file.
Hope that helps.
Regards,
Ryan
Views
Replies
Total Likes
Assuming you're not talking about a whole new page/window, and in fact a dynamic modal window that would not lend itself to adding the standard analytics code, you can just use the s.t() directly to "fire" a page view when the modal opens. We have done this many times. Let me know if you have any questions!
Views
Replies
Total Likes
Views
Likes
Replies