Google Analytics for Typeform embedded on wordpress website | Community
Skip to main content
Answered

Google Analytics for Typeform embedded on wordpress website


Forum|alt.badge.img

Ananlytics is working fine for me when using directly on form. But when I embed the form on my wordpress site, it is not working as event is not getting fired for typeform. I have created and connect GTM for this. But it is also not working for embedded form on website.

Best answer by mathio-tf

Hello @FW2021,

When you embed the form, you should enable sharing of your google analytics instance.

You will most likely need to use the the embed lib version 0 (zero) directly as a snippet and not via Wordpress plugin as it is most likely not supported.

 

You can use this HTML snippet:

<div
  class="typeform-widget"
  data-url="https://form.typeform.com/to/<form-id>"
  data-share-google-analytics-instance
></div>
<script src="//embed.typeform.com/embed.js"></script>

 

If you are using the lib in JavaScript you need to pass the shareGoogleAnalyticsInstance variable to config object:

typeformEmbed.makeWidget(
  embedElement,
  'https://form.typeform.com/to/<form-id>',
  {
    shareGoogleAnalyticsInstance: true
  }
)

More tech details in this Github pull request.

 

This is currently supported only in embed v0. Embed v1 will support this in future.

 

 

Update for Embed lib v1

 

Our latest embed lib version 1 supports this feature as well.

The attribute is named shareGaInstance (or data-tf-share-ga-instance if you use HTML embed code). You can even pass your GA tracking ID (UA-XXXXXX-X) to specify which tracker you want to use in case you have more than one on your website.

More information can be found in our README file on Github.

View original

21 replies

mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • Answer
  • April 26, 2021

Hello @FW2021,

When you embed the form, you should enable sharing of your google analytics instance.

You will most likely need to use the the embed lib version 0 (zero) directly as a snippet and not via Wordpress plugin as it is most likely not supported.

 

You can use this HTML snippet:

<div
  class="typeform-widget"
  data-url="https://form.typeform.com/to/<form-id>"
  data-share-google-analytics-instance
></div>
<script src="//embed.typeform.com/embed.js"></script>

 

If you are using the lib in JavaScript you need to pass the shareGoogleAnalyticsInstance variable to config object:

typeformEmbed.makeWidget(
  embedElement,
  'https://form.typeform.com/to/<form-id>',
  {
    shareGoogleAnalyticsInstance: true
  }
)

More tech details in this Github pull request.

 

This is currently supported only in embed v0. Embed v1 will support this in future.

 

 

Update for Embed lib v1

 

Our latest embed lib version 1 supports this feature as well.

The attribute is named shareGaInstance (or data-tf-share-ga-instance if you use HTML embed code). You can even pass your GA tracking ID (UA-XXXXXX-X) to specify which tracker you want to use in case you have more than one on your website.

More information can be found in our README file on Github.


Forum|alt.badge.img
  • Author
  • Explorer
  • 9 replies
  • April 26, 2021

@mathio Same google analytic instance is already connected with TypeForm as well as the webiste where I am embedding the typeform.

The only code I am currently using to embed TypeForm on my website is the code provided in the Share section of form. So in this case too, Do I need to use this sharing instance code on my website?


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • April 26, 2021

It seems the data-share-google-analytics-instance attribute is necessary only if you want to connect both sessions into one.

Do you have a link to the website that is embedding the typeform? Maybe I can have a look.


Forum|alt.badge.img
  • Author
  • Explorer
  • 9 replies
  • April 26, 2021

@mathio it can be checked here “https://www.futurewood.com.au/22477-2/


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • April 26, 2021

I can see in browser dev tools there is a request to collect data for Google Analytics when the form is opened in a popup:

https://www.google-analytics.com/j/collect?v=1

Do you have any ad blocks or other browser extensions that might block it? Can you try in incognito mode (without any extensions or ad blockers)?


Forum|alt.badge.img
  • Author
  • Explorer
  • 9 replies
  • April 26, 2021

@mathio GA is working fine till the form gets opened as GA is working on the website. But GA is not working for any activity inside the popup.


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14847 replies
  • May 12, 2021

Hi @FW2021 I took a look at this with @mathio  and we can see there is data being sent to Google Analytics when interacting with the form as shown below: 

 

Would you mind sending a screenshot of where you’re looking for the data in your Google Analytics account? Thanks in advance!


  • Navigating the Land
  • 4 replies
  • September 22, 2021

Hey everyone - I’m having the same trouble with my embedded type form on my website. Google analytics, when a user enters my website where my embedded form is, is counting 1 user as 2 (duplicate users) when they are on the page of my embedded typeform (here: https://www.temporary-url.com/EDAD6)

Can you provide instructions/(maybe html code for my typeform) as to how I can make the 1 user show up on google analytics as one user (not 2), as I don’t want to have duplicate users on my GA for obvious reasons (it’s the wrong information!). Thanks so much. 

Look forward to hearing.


  • Navigating the Land
  • 4 replies
  • September 22, 2021
mathio wrote:

It seems the data-share-google-analytics-instance attribute is necessary only if you want to connect both sessions into one.

Do you have a link to the website that is embedding the typeform? Maybe I can have a look.

I was told to put “data-tf-share-ga-instance” to fix this duplicate user issue, but that did not work. Thanks let me know!


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • September 23, 2021

Hello @P2021 , currently we are aware of an issue with Google Analytics. This issue prevents the session to be shared from your page to the typeform when you use data-tf-share-ga-instance attribute. We are currently investigating if the issue is on our side or if it was caused by google analytics library.

We will update you here once it is resolved.


  • Navigating the Land
  • 4 replies
  • September 23, 2021
mathio wrote:

Hello @P2021 , currently we are aware of an issue with Google Analytics. This issue prevents the session to be shared from your page to the typeform when you use data-tf-share-ga-instance attribute. We are currently investigating if the issue is on our side or if it was caused by google analytics library.

We will update you here once it is resolved.

No problem. Can you provide a timeline as to when this can be fixed by? As a marketer, I can’t see now proper conversion rates/cost per user acquisition, and it’s really messing it up. Thanks!


  • Navigating the Land
  • 4 replies
  • September 23, 2021
mathio wrote:

Hello @P2021 , currently we are aware of an issue with Google Analytics. This issue prevents the session to be shared from your page to the typeform when you use data-tf-share-ga-instance attribute. We are currently investigating if the issue is on our side or if it was caused by google analytics library.

We will update you here once it is resolved.

In the meantime, what are the form types (embedded, popup, etc.) that do work and don’t count duplicate users right now?


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • September 23, 2021

Sorry, I dont have a timeline for you right now, but I can say my teammate is working on it (its not in backlog but worked on). Unfortunately all embed types have the same issue right now.


Nordin
Typeform
Forum|alt.badge.img+3
  • Typeform
  • 31 replies
  • October 5, 2021

Hello All,

This issue should be solved now. If you still have any problems please contact our support team, so we can investigate. 


  • Navigating the Land
  • 3 replies
  • October 31, 2022

Hi there,

 

so, i came across to a lot of posts, where the main topic was the issue with tracking the source of the sessions in Google Analytics on landing page with embedded typeform.

 

Since this is 1 year old post and i still haven’t found a solution to this, i have decided to try my luck here.

 

So, we have embedded typeform on our website (Wordpress). We promote this typeform through LinkedIn, so we have created UTM. So if user clicks on our LinkedIn post, user comes to our landing page through UTM URL. However, when i check the real time report in Google Analytics, i can see 2 sessions. Google Analytics identify one session source as LinkedIn (which is correct), but also one session source as Direct. I am also adding the screenshot from our Google Analytics. It’s in our native language tho, but you can see the medium, source and page views in those columns.

 

The biggest problem is, that if user interacts with our typeform, we can see the source of each events (“TypeformQuestionPassed” and “TypeformSubmit”) as direct and not as LinkedIn, as we are supposed to.

Could you please help me to set this tracking right so we can identify, which channels bring us conversions?

For more information let me know.

 

Thank you!


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14847 replies
  • November 1, 2022

Hi @Martin ATM Thanks for stopping by! Have you tried implementing the solution Mathio shared above? 


  • Navigating the Land
  • 3 replies
  • November 2, 2022

Hi Liz,

 

yes, i have tried to edit the html as instructed, but it is still not working correct. What else could i try?

 

As i was going through this thread, i have noticed, that there was an issue with all embed forms one year ago. So i guess it was not fixed? Could you please let me know?

 

Thank you.


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14847 replies
  • November 2, 2022

Could you share the URL where you have the form embedded, @Martin ATM ?


  • Navigating the Land
  • 3 replies
  • November 4, 2022

Hi,

 

i have created testing form here → https://alttag.digital/typeform-test/ and i edited the html there. Even checked out this link → https://github.com/Typeform/embed/tree/main/packages/embed#share-google-analytics-instance. Nothing has worked so far.


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14847 replies
  • November 4, 2022

Thanks, @Martin ATM ! I can see below that the data is sending to Google Analytics: 

If you’re still not seeing the data, you’ll want to contact Google Analytics for further support and/or check that you don’t have any extra filters on that might be preventing the data from showing. 


Forum|alt.badge.img

Hello all!

I’ve developed a customized version of Typeform tracking.

Here’s the details if some of you want to give it a try.

https://www.linkedin.com/pulse/solving-frustrations-typeform-gagtm-tracking-elegant-giovani/


Reply