Google Universal Analytics tracking code

  • linceb
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 77
  • Thank you received: 0

linceb replied the topic: Google Universal Analytics tracking code

Hi,
I've finally found the solution by myself, but there's something strange.
1/ solution for my tracking code when the thank you page is viewed (the second page of the form) : advanced options of the form => more options => scripts => submitted scripts => custom :

function ff_contact_submitted(status, message)
{
  if(status==0)
  {
    ff_switchpage(2);
    ga('send', 'pageview', '/contact/thanks.html');
  }
    else{alert(message);
  }
}

This is working. I had problems because the function name I used was not the same as the form name !!!
My form name is "contact" so the function has to be called like this : function ff_contact_submitted()

2/ now I've found something strange.... when I modify my form (an element or whatever except the "more options" of the advanced ones) I save the properties and the I save the form itself. When I do this, my script in the advanced options is changed!!! the part with the google analytics tracking code is deleted!!!

function ff_contact_submitted(status, message){if(status==0){ff_switchpage(2);}else{alert(message);}}
So I have to go back to the script and manually add again the code.

Now I know it, I always go back to the script after having saved the form but this shouldn't be needed I guess.
#182954
  • Posts: 2667
  • Karma: 76
  • Thank you received: 329

lovre replied the topic: Google Universal Analytics tracking code

Hi,

You probably have the option "last page is a thank you page" and that's the reason the script is overwritten.

You can try alternative ways of implementing analytics like i suggested bellow.

Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===========================================
Need to renew Pro Support?
Buy Here!
===========================================
Satisfied?
Consider a membership!
===========================================
Like us on Facebook
===========================================
#182961
The following user(s) said Thank You: linceb
  • linceb
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 77
  • Thank you received: 0

linceb replied the topic: Google Universal Analytics tracking code

ok, I understand now why the script is overwritten.
Thanks a lot for your help
#183009
  • Posts: 2667
  • Karma: 76
  • Thank you received: 329

lovre replied the topic: Google Universal Analytics tracking code

OK, great.

Let us know if you have more questions.

Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===========================================
Need to renew Pro Support?
Buy Here!
===========================================
Satisfied?
Consider a membership!
===========================================
Like us on Facebook
===========================================
#183015
Moderators: ForumSupporttomeperica
Time to create page: 0.074 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here