AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
5.4K members online now
5.4K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Goal without destination page (want to use a script)...

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have a site where a user must register to see additional properties (for real estate).  There is a popup where they are required to enter their info in order to continue but the popup's second page doesn't have a url of it's own to use as a goal in analytics.

 

I do have the ability to fire a script on that second page.  The site has a box in the admin where I can input the code for the script.  I'm using this box for the adwords conversion script but have the ability to add another.

 

Anyone know how to utilize a script in order to track a goal?

Goal without destination page (want to use a script)...

Participant ✭ ✭ ☆
# 2
Participant ✭ ✭ ☆

You can send an event and then create a new goal based on that event.

To send an event just put this javascript code to your script:

ga("send","event","eventCategory","eventAction","eventLabel");

More about events you can learn from documentation:

https://developers.google.com/analytics/devguides/collection/analyticsjs/events

 

If you use classic version of Analytics tracking code place this code into your script:

_gaq.push(["_trackEvent", "eventCategory","eventAction","eventLabel"]);

 

Ofcourse replace "eventCategory","eventAction","eventLabel" with your own names.

 

Goal without destination page (want to use a script)...

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thanks!  Assuming I am on the "newer" version of analytics I can leave the bold portion as is right?

 

ga("send","event","eventCategory","eventAction","eventLabel");

 

And when you say "put this javascript code in your script:", can i just add it in the last line of the adwords conversion script I'm already using?  Right before the </script> line?

 

Goal without destination page (want to use a script)...

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hi Lindsey,

 

Yes, you can add it in that code block. All code within the <script> block will execute, it is not specifically linked to Adwords.

 

To debug, you could always use the console of the Chrome Developers Tools. You can copy paste the code and execute it. Then, you can use a tool like dataslayer to check whether the event is configured correctly.