javascript - Can I track an IFRAME widget with Google Analytics? - Stack Overflow

We are going to launch JS based widgets which webmasters (any site) will be putting on their site by em

We are going to launch JS based widgets which webmasters (any site) will be putting on their site by embedding a small code snippet like :

<iframe src="SOURCE_PATH" frameborder="0" width="300px" height="150px"  scrolling="no" id="cd_frame"></iframe>

Inside the widget there are three links and we need to track how many clicks are happening on them from the external sites where the widget is going to get used.

If I simply put the code which GA provides will that work? OR do I need to make any changes?

Thanks.

We are going to launch JS based widgets which webmasters (any site) will be putting on their site by embedding a small code snippet like :

<iframe src="SOURCE_PATH" frameborder="0" width="300px" height="150px"  scrolling="no" id="cd_frame"></iframe>

Inside the widget there are three links and we need to track how many clicks are happening on them from the external sites where the widget is going to get used.

If I simply put the code which GA provides will that work? OR do I need to make any changes?

Thanks.

Share Improve this question edited Aug 14, 2009 at 11:53 viam0Zah 26.3k8 gold badges79 silver badges103 bronze badges asked Jul 6, 2009 at 7:34 RamnathRamnath 1411 silver badge6 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

you should be able to track from your iframe as it would appear to google analytics as a regular page. your issue would be knowing what iframe you were tracking. if you can pass a unique id via the iframe url then you should be able to add a custom parameter to track the different sites.

eg

<iframe src="SOURCE_PATH?uniquetrackingid=123" frameborder="0" width="300px" 
height="150px" scrolling="no" id="cd_frame"></iframe>

information about custom tracking codes can be found here http://www.google./support/analytics/bin/answer.py?hl=en&answer=55585

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744332485a4568955.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信