Google Universal Analytics onClick - analytics

Looking for some pointers on introducing UA into our website and not sure how to convert the following code extract ...
[button id="onepage-guest-register-button" type="button" class="button"
onclick="window.location='https://www.jjjoneshomes.com/account'"]
... which already has the onClick ref into what the UA OnClick Event Tracking is asking for?
Any advice appreciated, an example greatly!
Thanks, Walts

This resource may help you with what you are asking.
UA event tracking normally looks something like this (assuming you use jQuery):
Click here
If you follow the guide above, make sure you don't copy and paste it exactly as it is as there are some errors with the single quote types - they need to be straight quotes, not angled.

Related

How do i create a discord link like discord.com/invite/xxxxx

Discord.com/invite
I tried creating an account and thought it would come exactly like discord.com/invite but if you where to custom the link it would come as discord.gg/ but im looking for how to make it discord.com/invite/xxxxx
Right click the server in question, navigate to "Invite People" and copy the generated link. Once done, your link will look something like this: https://discord.gg/xxxxxxx
You'll want to replace it with https://discord.com/invite/xxxxxxx instead, of course replacing the Xs with your actual invite code.

How to custom placeholder in international phone number plugin

I have problem with custom placeholder. I am using this https://github.com/mareczek/international-phone-number I want to add more ex. E.g. 131123456789 to my place holder which default gave something like this 131123456789. I read the document they use customPlaceholder to custom place holder, but they do not have any example with angularjs, so could someone show me example code with custom place holder like this.
Here my code that I added to my app
app.config([
'$stateProvider',
ipnConfig,
register_form_state
])->ipnConfig.customPlaceholder = 'E.g. 131123456789'
but it doesn't work for me.
This will solve this problem
http://hodgepodgers.github.io/ng-intl-tel-input/
Please refer this link & this is angularJS plugin
https://github.com/hodgepodgers/ng-intl-tel-input
On selection of country, placeholder will change
The documentation for http://hodgepodgers.github.io/ng-intl-tel-input/ is lacking, but it seems like it could be a good tool. I think I would personally like to see a working implementation inside of an existing application before I'd rule it as the solution to use. I'm still having trouble implementing this one compared to the one by mareczek.
edit To answer your question, I think that it changes the placeholder based on the flag you have selected. If you have it set to a default country, can you not just change the placeholder in the html? Or can you target it directly using css?

How to click the buttons without element id

Im using protractor for e2e testing.I want to click the buttons
Is there any reason you're not using the Protractor API, but the driver directly? Selecting by ng-click might not be the best approach here as well (good practice seems to be selecting based on page structure, not mechanics), I would recommend you to investigate if you can't simply use by.buttonText:
element(by.buttonText('Place Order'));
EDIT: Looking at the way the selector is made, the above will not work - please note by.buttonText will only match:
button
input type="button"
input type="submit"
I'm keeping this for anyone who might need this in the future.
If that will not work, maybe you could at least select it by class, e.g. inside a parent? For example:
element(by.css('.btn-wrapper > .btn:nth-child(2)'));
Also, consider adding a separate class/id for the button, it might be useful later anyway.
Last remark, if you have a large page to test, consider using page objects instead of selecting same stuff in separate steps. This way, instead of writing the selector, you'll have a nice, maintainable object, that you can use like:
myPage.placeOrderButton().click();
Just something to consider.
Place order button:
$('[ng-if*="checkout"]').click();
Cancel button:
$('[ui-sref=​"main.store.featured"]').click();
This should work:
element(by.css('[ng-click="ctrl.placeOrder()"]')).click();
I think the simplest and the most readable approach here would be to locate the element by text:
element(by.xpath('//div[. = "Place Order"]'));
You may just need to add a wait for element to become visible:
var EC = protractor.ExpectedConditions,
placeOrder = element(by.xpath('//div[. = "Place Order"]'));
browser.wait(EC.visibilityOf(placeOrder), 5000);
placeOrder.click();
I don't know if this will help, but I found an article where someone was having issues clicking on a div. It seems a bit much for just clicking on a div but I figured the link could help you out
https://adventuresintesting.wordpress.com/tag/protractor-doesnt-click-div/

style an element using an angular filter

I would like to style a couple of elements using a filter to decipher if it should be yellow or red.
I understand filters should not carry logic operations in them as such so am guessing a service is the first port of call before i create any filter for it.
I am leveraging data from a backend (still a bit unsure of the Backend model here, but know I can leverage certain objects to obtain the data needed for working on) I mostly need to know if i`m on the right path by using a service to control the logical outcome and then a filter to provide 'filtration' of that outcome.
BTW: sorry, im waiting for my project to checkout from SVN at mo so cannot provide a skeleton attempt.
Will do in a bit though .....
Any advice before hand will be much appreciated
:) Gruffy - thanks for reading
You can directly set the class attribute if you want, so your filter can simply return the CSS class to apply:
<p class="{{'foo'|myFilter}}">Foo</p>
Here's a fiddle showing what I mean.

Implementing basic next/previous picture

I'm trying to convert the Adjuster example mentioned here: http://agiletoolkit.org/learn/understand/view/interactive
into a View that is able to show me the next/previous picture of a list of given images.
I guess the number in the example could be an index into an array of pictures.
I'm just not sure how to provide the list of pictures, when all the code is put in init() for the View, so no way to give it the picturelist before that...
Should I use memorize/recall for this list also to prevent it getting lost upon reload ?
is there another example that might help me?
I think you what you are doing can be much easier done with a classic JavaScript Lightbox script. You would supply it list of images and it would show one full-screen.
If not, you can use this:
https://gist.github.com/romaninsh/7217119
This will give you slides similar to the ones on http://agiletech.ie/
Be advised that this code is a little old.

Resources